Enum wasefire_error::Code
source · #[non_exhaustive]#[repr(u16)]pub enum Code {
Generic = 0,
NotImplemented = 1,
NotFound = 2,
InvalidLength = 3,
InvalidAlign = 4,
NoPermission = 5,
NotEnough = 6,
InvalidState = 7,
InvalidArgument = 8,
}
Expand description
Common error codes.
Values from 0 to 32767 (0x7fff) are reserved for common error codes and defined by this enum. Values from 32768 (0x8000) to 65535 (0xffff) are reserved for implementation-specific error codes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Generic = 0
NotImplemented = 1
The operation is not implemented.
NotFound = 2
An input was not found.
InvalidLength = 3
An input has an invalid length.
InvalidAlign = 4
An input has an invalid alignment.
NoPermission = 5
The caller does not have permission for the operation.
NotEnough = 6
There is not enough resource for the operation.
InvalidState = 7
An input is invalid for the current state.
This could also be that the current state is invalid for all inputs and cannot progress anymore.
InvalidArgument = 8
An input is invalid.
This is a generic error. More precise errors would be InvalidLength
, InvalidAlign
,
InvalidState
, or NotFound
for example.
Trait Implementations§
source§impl TryFrom<u16> for Code
impl TryFrom<u16> for Code
§type Error = TryFromPrimitiveError<Code>
type Error = TryFromPrimitiveError<Code>
The type returned in the event of a conversion error.
source§impl TryFromPrimitive for Code
impl TryFromPrimitive for Code
impl CodeParam for Code
impl Copy for Code
Auto Trait Implementations§
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
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