pub struct Status<const MIN: c_int, const MAX: c_int>(/* private fields */);Expand description
A native scalar retained with the exact domain its producer guarantees, so every decoder below is total: the producer’s ABI proof is discharged once at construction and reused without a second range check.
Implementations§
Source§impl Status<-1, { i32::MAX }>
impl Status<-1, { i32::MAX }>
Sourcepub const unsafe fn from_count(raw: ssize_t) -> Self
pub const unsafe fn from_count(raw: ssize_t) -> Self
Retains a native count whose exact syscall operand already bounds it.
§Safety
raw is the unchanged return of that count-returning syscall: native -1 or 0..=i32::MAX.
Sourcepub fn try_value<E: From<Errno>>(
self,
errno: impl FnOnce() -> Errno,
) -> Result<Value, E>
pub fn try_value<E: From<Errno>>( self, errno: impl FnOnce() -> Errno, ) -> Result<Value, E>
Converts the retained native scalar domain without checking its range again.
Sourcepub unsafe fn try_count<E: From<Errno>>(
self,
errno: impl FnOnce() -> Errno,
) -> Result<Count, E>
pub unsafe fn try_count<E: From<Errno>>( self, errno: impl FnOnce() -> Errno, ) -> Result<Count, E>
Decodes one count-returning operation against the exact extent it was given.
§Safety
errno reads that thread’s slot before another syscall.
Sourcepub const unsafe fn admit_exact<const VALUE: c_int>(self) -> Exact<VALUE>
pub const unsafe fn admit_exact<const VALUE: c_int>(self) -> Exact<VALUE>
Tightens this scalar to one operation’s exact -1-or-VALUE return.
§Safety
That operation reports exactly VALUE or -1 for these arguments.
Trait Implementations§
impl<const MIN: c_int, const MAX: c_int> Copy for Status<MIN, MAX>
Auto Trait Implementations§
impl<const MIN: i32, const MAX: i32> Freeze for Status<MIN, MAX>
impl<const MIN: i32, const MAX: i32> RefUnwindSafe for Status<MIN, MAX>
impl<const MIN: i32, const MAX: i32> Send for Status<MIN, MAX>
impl<const MIN: i32, const MAX: i32> Sync for Status<MIN, MAX>
impl<const MIN: i32, const MAX: i32> Unpin for Status<MIN, MAX>
impl<const MIN: i32, const MAX: i32> UnsafeUnpin for Status<MIN, MAX>
impl<const MIN: i32, const MAX: i32> UnwindSafe for Status<MIN, MAX>
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