Struct getrandom::Error [−][src]
pub struct Error(_);
Expand description
A small and no_std
compatible error type.
The Error::raw_os_error()
will indicate if the error is from the OS, and
if so, which error code the OS gave the application. If such an error is
encountered, please consult with your system documentation.
Internally this type is a NonZeroU32, with certain values reserved for
certain purposes, see Error::INTERNAL_START
and Error::CUSTOM_START
.
Implementations
👎 Deprecated since 0.1.7
System entropy source is unavailable.
Codes below this point represent OS Errors (i.e. positive i32 values).
Codes at or above this point, but below Error::CUSTOM_START
are
reserved for use by the rand
and getrandom
crates.
Codes at or above this point can be used by users to define their own custom errors.
Extract the raw OS error code (if this error came from the OS)
This method is identical to std::io::Error::raw_os_error()
, except
that it works in no_std
contexts. If this method returns None
, the
error value can still be formatted via the Display
implementation.
Extract the bare error code.
This code can either come from the underlying OS, or be a custom error.
Use Error::raw_os_error()
to disambiguate.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more