pub struct OptUs(/* private fields */);Expand description
Optional time field with a sentinel 0 for “absent”.
Phase 110.B keeps a stable #[repr(transparent)] u32 layout so
cbindgen emits plain uint32_t for C consumers — Option<NonZeroU32>
loses its niche optimization the moment a #[repr(C)] struct
embeds it. Rust callers see the ergonomic
get-returning-Option<NonZeroU32> getter.
Sentinel 0 is physically meaningful for every time field on
SchedContext: 0-period would mean infinite frequency, 0-budget
means unbounded, 0-deadline means no deadline.
Implementations§
Source§impl OptUs
impl OptUs
pub const NONE: Self
pub const fn from_us(us: u32) -> Self
pub const fn from_nz(nz: NonZeroU32) -> Self
Sourcepub const fn get(self) -> Option<NonZeroU32>
pub const fn get(self) -> Option<NonZeroU32>
Returns the inner value or None when the sentinel is set.
pub const fn is_some(self) -> bool
pub const fn raw(self) -> u32
Trait Implementations§
impl Copy for OptUs
impl Eq for OptUs
impl StructuralPartialEq for OptUs
Auto Trait Implementations§
impl Freeze for OptUs
impl RefUnwindSafe for OptUs
impl Send for OptUs
impl Sync for OptUs
impl Unpin for OptUs
impl UnsafeUnpin for OptUs
impl UnwindSafe for OptUs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more