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 unsafe fn try_value<S: Source + ?Sized, E: From<Errno>>(
self,
) -> Result<Value, E>
pub unsafe fn try_value<S: Source + ?Sized, E: From<Errno>>( self, ) -> Result<Value, E>
Converts the retained native scalar domain without checking its range again.
§Safety
On failure, S reads this call’s positive, unchanged errno.
Sourcepub unsafe fn try_count<S: Source + ?Sized, E: From<Errno>>(
self,
) -> Result<Count, E>
pub unsafe fn try_count<S: Source + ?Sized, E: From<Errno>>( self, ) -> Result<Count, E>
Decodes one count-returning operation against the exact extent it was given.
§Safety
On failure, S reads this call’s positive, unchanged errno.
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.