pub enum RandomBitsError<T> {
RandCore(T),
BitsPrecisionMismatch {
bits_precision: u32,
integer_bits: u32,
},
BitLengthTooLarge {
bit_length: u32,
bits_precision: u32,
},
}Available on crate feature
rand_core only.Expand description
Possible errors of the methods in RandomBits trait.
Variants§
RandCore(T)
An error of the internal RNG library.
BitsPrecisionMismatch
The requested bits_precision does not match the size of the integer
corresponding to the type (in the cases where this is set in compile time).
Fields
BitLengthTooLarge
The requested bit_length is larger than bits_precision.
Trait Implementations§
Source§impl<T: Debug> Debug for RandomBitsError<T>
impl<T: Debug> Debug for RandomBitsError<T>
Source§impl<T> Display for RandomBitsError<T>where
T: Display,
impl<T> Display for RandomBitsError<T>where
T: Display,
Source§impl<T> Error for RandomBitsError<T>
impl<T> Error for RandomBitsError<T>
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()
Auto Trait Implementations§
impl<T> Freeze for RandomBitsError<T>where
T: Freeze,
impl<T> RefUnwindSafe for RandomBitsError<T>where
T: RefUnwindSafe,
impl<T> Send for RandomBitsError<T>where
T: Send,
impl<T> Sync for RandomBitsError<T>where
T: Sync,
impl<T> Unpin for RandomBitsError<T>where
T: Unpin,
impl<T> UnsafeUnpin for RandomBitsError<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RandomBitsError<T>where
T: UnwindSafe,
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