pub struct UnwrapMut<'r, R: TryRngCore + ?Sized>(pub &'r mut R);
Expand description
Wrapper around TryRngCore
implementation which implements RngCore
by panicking on potential errors.
Tuple Fields§
§0: &'r mut R
Implementations§
Source§impl<'r, R: TryRngCore + ?Sized> UnwrapMut<'r, R>
impl<'r, R: TryRngCore + ?Sized> UnwrapMut<'r, R>
Sourcepub fn re<'b>(&'b mut self) -> UnwrapMut<'b, R>where
'r: 'b,
pub fn re<'b>(&'b mut self) -> UnwrapMut<'b, R>where
'r: 'b,
Reborrow with a new lifetime
Rust allows references like &T
or &mut T
to be “reborrowed” through
coercion: essentially, the pointer is copied under a new, shorter, lifetime.
Until rfcs#1403 lands, reborrows on user types require a method call.
Trait Implementations§
impl<R: TryCryptoRng + ?Sized> CryptoRng for UnwrapMut<'_, R>
impl<'r, R: Eq + TryRngCore + ?Sized> Eq for UnwrapMut<'r, R>
impl<'r, R: TryRngCore + ?Sized> StructuralPartialEq for UnwrapMut<'r, R>
Auto Trait Implementations§
impl<'r, R> Freeze for UnwrapMut<'r, R>where
R: ?Sized,
impl<'r, R> RefUnwindSafe for UnwrapMut<'r, R>where
R: RefUnwindSafe + ?Sized,
impl<'r, R> Send for UnwrapMut<'r, R>
impl<'r, R> Sync for UnwrapMut<'r, R>
impl<'r, R> Unpin for UnwrapMut<'r, R>where
R: ?Sized,
impl<'r, R> !UnwindSafe for UnwrapMut<'r, R>
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
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32
.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64
.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest
entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut
wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self> ⓘwhere
Self: Sized,
Convert an
RngCore
to a RngReadAdapter
.