pub trait AvrAtomicConvert: Copy {
// Required methods
fn from_u8(value: u8) -> Self;
fn to_u8(self) -> u8;
}Expand description
Trait convert to and from the raw u8 value.
Required Methods§
Sourcefn from_u8(value: u8) -> Self
fn from_u8(value: u8) -> Self
Convert from u8 to Self.
§Implementation hint
This function must create a valid Self value from the value byte.
Note that a value of 0_u8 must always be expected and handled correctly,
because 0_u8 is the initialization value of AvrAtomic.
It is guaranteed that AvrAtomic only ever passes values to from_u8
that came from to_u8() or are equal to 0_u8.
Note that 0_u8 can be passed to from_u8 even if to_u8() never returned 0_u8.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.