pub struct UrandomError { /* private fields */ }
Expand description
Error that indicates the system source of cryptographically secure randomness failed to read the requested bytes.
This can occur if the source is unknown or lacks sufficient entropy.
This error is returned by urandom()
. See its documentation for more
details.
This error corresponds to the Ruby RuntimeError
Exception class.
§Examples
use spinoso_random::UrandomError;
let err = UrandomError::new();
assert_eq!(err.message(), "failed to get urandom");
Implementations§
Trait Implementations§
Source§impl Clone for UrandomError
impl Clone for UrandomError
Source§fn clone(&self) -> UrandomError
fn clone(&self) -> UrandomError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UrandomError
impl Debug for UrandomError
Source§impl Default for UrandomError
impl Default for UrandomError
Source§fn default() -> UrandomError
fn default() -> UrandomError
Returns the “default value” for a type. Read more
Source§impl Display for UrandomError
impl Display for UrandomError
Source§impl Error for UrandomError
impl Error for UrandomError
1.30.0 · 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<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 Hash for UrandomError
impl Hash for UrandomError
Source§impl Ord for UrandomError
impl Ord for UrandomError
Source§fn cmp(&self, other: &UrandomError) -> Ordering
fn cmp(&self, other: &UrandomError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for UrandomError
impl PartialEq for UrandomError
Source§impl PartialOrd for UrandomError
impl PartialOrd for UrandomError
impl Copy for UrandomError
impl Eq for UrandomError
impl StructuralPartialEq for UrandomError
Auto Trait Implementations§
impl Freeze for UrandomError
impl RefUnwindSafe for UrandomError
impl Send for UrandomError
impl Sync for UrandomError
impl Unpin for UrandomError
impl UnwindSafe for UrandomError
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