add get set fill macro
This commit is contained in:
parent
3c27917afa
commit
8d5e408653
6 changed files with 86 additions and 83 deletions
19
src/brightness.rs
Normal file
19
src/brightness.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
use crate::UniffiCustomTypeConverter;
|
||||
use servicepoint::Brightness;
|
||||
|
||||
uniffi::custom_type!(Brightness, u8);
|
||||
|
||||
impl UniffiCustomTypeConverter for Brightness {
|
||||
type Builtin = u8;
|
||||
|
||||
fn into_custom(val: Self::Builtin) -> uniffi::Result<Self>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
Ok(Brightness::saturating_from(val))
|
||||
}
|
||||
|
||||
fn from_custom(obj: Self) -> Self::Builtin {
|
||||
obj.into()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue