#[repr(transparent)]pub(super) struct RetReg<Num: RetNumber> {
raw: *mut Opaque,
_phantom: PhantomData<Num>,
}
Expand description
Syscall return values use register-sized types. We use a newtype to discourage accidental misuse of the raw integer values.
This type doesn’t implement Clone
or Copy
; it should be used exactly
once.
Fields§
§raw: *mut Opaque
§_phantom: PhantomData<Num>
Implementations§
source§impl<Num: RetNumber> RetReg<Num>
impl<Num: RetNumber> RetReg<Num>
pub(super) fn decode_usize(self) -> usize
pub(super) fn decode_raw_fd(self) -> RawFd
pub(super) fn decode_c_int(self) -> c_int
pub(super) fn decode_c_uint(self) -> c_uint
pub(super) fn decode_void_star(self) -> *mut c_void
pub(super) fn decode_u64(self) -> u64
pub(super) fn decode_void(self)
pub(super) fn decode_error_code(self) -> u16
pub(super) fn is_nonzero(&self) -> bool
pub(super) fn is_negative(&self) -> bool
pub(super) fn is_in_range(&self, range: Range<isize>) -> bool
Trait Implementations§
impl<Num: RetNumber> Sealed for RetReg<Num>
Auto Trait Implementations§
impl<Num> Freeze for RetReg<Num>
impl<Num> RefUnwindSafe for RetReg<Num>where
Num: RefUnwindSafe,
impl<Num> !Send for RetReg<Num>
impl<Num> !Sync for RetReg<Num>
impl<Num> Unpin for RetReg<Num>where
Num: Unpin,
impl<Num> UnwindSafe for RetReg<Num>where
Num: UnwindSafe,
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