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
.
If this crate’s "std"
Cargo feature is enabled, then:
getrandom::Error
implementsstd::error::Error
std::io::Error
implementsFrom<getrandom::Error>
.
Implementations
This target/platform is not supported by getrandom
.
The platform-specific errno
returned a non-positive value.
Call to iOS SecRandomCopyBytes
failed.
Call to Windows RtlGenRandom
failed.
RDRAND instruction failed due to a hardware issue.
The browser does not have support for self.crypto
.
The browser does not have support for crypto.getRandomValues
.
On VxWorks, call to randSecure
failed (random number generator is not yet initialized).
NodeJS does not have support for the crypto
module.
NodeJS does not have support for crypto.randomFillSync
.
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