Enum oc_wasm_safe::error::Error
source · [−]pub enum Error {
CborDecode,
BufferTooShort,
NoSuchComponent,
NoSuchMethod,
BadParameters,
QueueFull,
QueueEmpty,
BadDescriptor,
TooManyDescriptors,
Other,
Unknown,
}Expand description
The errors that a system call can return.
Variants
CborDecode
BufferTooShort
NoSuchComponent
NoSuchMethod
BadParameters
QueueFull
QueueEmpty
BadDescriptor
TooManyDescriptors
Other
Unknown
Implementations
sourceimpl Error
impl Error
sourcepub fn from_isize(value: isize) -> Result<usize>
pub fn from_isize(value: isize) -> Result<usize>
Checks a system call return value of type isize for an error value.
Returns a Result containing an Error if the value is negative, or the original value if
it was nonnegative.
Errors
This function fails if the parameter is negative, decoding the represented error code.
Panics
This function panics if the syscall error code is MemoryFault or StringDecode. These
syscall errors should be impossible in safe code because the type system prohibits them:
MemoryFault should be impossible because all memory regions are taken as slices which are
always valid, and StringDecode should be impossible because all strings are taken as
string-slices (&str) which are always valid UTF-8.
sourcepub fn from_i32(value: i32) -> Result<u32>
pub fn from_i32(value: i32) -> Result<u32>
Checks a system call return value of type i32 for an error value.
Returns a Result containing an Error if the value is negative, or the original value if
it was nonnegative.
Errors
This function fails if the parameter is negative, decoding the represented error code.
Panics
This function panics if the syscall error code is MemoryFault or StringDecode. These
syscall errors should be impossible in safe code because the type system prohibits them:
MemoryFault should be impossible because all memory regions are taken as slices which are
always valid, and StringDecode should be impossible because all strings are taken as
string-slices (&str) which are always valid UTF-8.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<MethodCallError<'_>> for Error
impl From<MethodCallError<'_>> for Error
sourcefn from(source: MethodCallError<'_>) -> Self
fn from(source: MethodCallError<'_>) -> Self
Converts to this type from the input type.
sourceimpl TryFrom<Error> for MethodCallError<'static>
impl TryFrom<Error> for MethodCallError<'static>
impl Copy for Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more