add get set fill macro

This commit is contained in:
Vinzenz Schroeter 2025-06-13 09:52:07 +02:00
parent 3c27917afa
commit 8d5e408653
6 changed files with 86 additions and 83 deletions

19
src/brightness.rs Normal file
View 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()
}
}