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
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<ArgumentError> for Error
impl From<ArgumentError> for Error
sourcefn from(err: ArgumentError) -> Self
fn from(err: ArgumentError) -> Self
Converts to this type from the input type.
sourceimpl From<InitializeError> for Error
impl From<InitializeError> for Error
sourcefn from(err: InitializeError) -> Self
fn from(err: InitializeError) -> Self
Converts to this type from the input type.
sourceimpl From<NewSeedError> for Error
impl From<NewSeedError> for Error
sourcefn from(err: NewSeedError) -> Self
fn from(err: NewSeedError) -> Self
Converts to this type from the input type.
sourceimpl From<UrandomError> for Error
impl From<UrandomError> for Error
sourcefn from(err: UrandomError) -> Self
fn from(err: UrandomError) -> Self
Converts to this type from the input type.
sourceimpl PartialOrd<Error> for Error
impl PartialOrd<Error> for Error
sourcefn partial_cmp(&self, other: &Error) -> Option<Ordering>
fn partial_cmp(&self, other: &Error) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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
impl Copy for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more