Enum spinoso_random::Error
source · pub enum Error {
Argument(ArgumentError),
Initialize(InitializeError),
NewSeed(NewSeedError),
Urandom(UrandomError),
}
Expand description
Sum type of all errors possibly returned from Random
functions.
Random functions in spinoso-random
return errors in the following
conditions:
- The platform source of cryptographic randomness is unavailable.
- The platform source of cryptographic randomness does not have sufficient entropy to return the requested bytes.
- Constraints for bounding random numbers are invalid.
Variants§
Argument(ArgumentError)
Error that indicates rand()
was passed an invalid constraint.
See ArgumentError
.
Initialize(InitializeError)
Error that indicates that Random::new
failed to generate a random
seed.
See InitializeError
.
NewSeed(NewSeedError)
Error that indicates that new_seed
failed to generate a random seed.
See NewSeedError
.
Urandom(UrandomError)
Error that indicates that urandom()
failed to generate the requested
random bytes from the platform source of randomness.
See UrandomError
.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ArgumentError> for Error
impl From<ArgumentError> for Error
source§fn from(err: ArgumentError) -> Self
fn from(err: ArgumentError) -> Self
Converts to this type from the input type.
source§impl From<InitializeError> for Error
impl From<InitializeError> for Error
source§fn from(err: InitializeError) -> Self
fn from(err: InitializeError) -> Self
Converts to this type from the input type.
source§impl From<NewSeedError> for Error
impl From<NewSeedError> for Error
source§fn from(err: NewSeedError) -> Self
fn from(err: NewSeedError) -> Self
Converts to this type from the input type.
source§impl From<UrandomError> for Error
impl From<UrandomError> for Error
source§fn from(err: UrandomError) -> Self
fn from(err: UrandomError) -> Self
Converts to this type from the input type.
source§impl PartialEq<Error> for Error
impl PartialEq<Error> for Error
source§impl PartialOrd<Error> for Error
impl PartialOrd<Error> for Error
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more