pub struct SyscallReturnCode<T: From<i8> + Eq = c_int>(pub T);
Expand description
Wrapper to interpret syscall exit codes and provide a rustacean io::Result
.
Tuple Fields§
§0: T
Implementations§
Source§impl<T: From<i8> + Eq> SyscallReturnCode<T>
impl<T: From<i8> + Eq> SyscallReturnCode<T>
Sourcepub fn into_result(self) -> Result<T>
pub fn into_result(self) -> Result<T>
Returns the last OS error if value is -1 or Ok(value) otherwise.
Sourcepub fn into_empty_result(self) -> Result<()>
pub fn into_empty_result(self) -> Result<()>
Returns the last OS error if value is -1 or Ok(()) otherwise.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SyscallReturnCode<T>where
T: Freeze,
impl<T> RefUnwindSafe for SyscallReturnCode<T>where
T: RefUnwindSafe,
impl<T> Send for SyscallReturnCode<T>where
T: Send,
impl<T> Sync for SyscallReturnCode<T>where
T: Sync,
impl<T> Unpin for SyscallReturnCode<T>where
T: Unpin,
impl<T> UnwindSafe for SyscallReturnCode<T>where
T: 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