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)>
Returns 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 PartialOrd for Error
impl PartialOrd for Error
impl Copy for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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