Skip to main content

Status

Struct Status 

Source
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<const MIN: c_int, const MAX: c_int> Status<MIN, MAX>

Source

pub const unsafe fn new(raw: c_int) -> Self

Retains the return domain established by one native operation.

§Safety

raw lies in MIN..=MAX, as guaranteed by the operation producing it.

Source§

impl Status<-1, 0>

Source

pub unsafe fn try_zero<S: Source + ?Sized, E: From<Errno>>( self, ) -> Result<(), E>

Decodes a native zero-or-minus-one operation without erasing errno.

§Safety

On failure, S reads this call’s positive, unchanged errno.

Source§

impl Status<-1, { i32::MAX }>

Source

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.

Source

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.

Source

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.

Source

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.

Source§

impl Status<0, { i32::MAX }>

Source

pub fn try_pthread(self) -> Result<(), Errno>

Decodes the error code returned directly by a pthread operation.

Trait Implementations§

Source§

impl<const MIN: c_int, const MAX: c_int> Clone for Status<MIN, MAX>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const MIN: c_int, const MAX: c_int> Copy for Status<MIN, MAX>

Source§

impl<const MIN: c_int, const MAX: c_int> Debug for Status<MIN, MAX>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const MIN: i32, const MAX: i32> Forget for Status<MIN, MAX>

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Convert<T> for T

Source§

fn into(self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.