Struct snarkvm_polycommit::optional_rng::OptionalRng[][src]

pub struct OptionalRng<R>(pub Option<R>);

OptionalRng is a hack that is necessary because Option<&mut R> is not implicitly reborrowed like &mut R is. This causes problems when a variable of type Option<&mut R> is moved (eg, in a loop).

To overcome this, we define the wrapper OptionalRng here that can be borrowed mutably, without fear of being moved.

Trait Implementations

impl<R: RngCore> From<R> for OptionalRng<R>[src]

impl<R: RngCore> RngCore for OptionalRng<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for OptionalRng<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for OptionalRng<R> where
    R: Send
[src]

impl<R> Sync for OptionalRng<R> where
    R: Sync
[src]

impl<R> Unpin for OptionalRng<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for OptionalRng<R> where
    R: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<R> Rng for R where
    R: RngCore + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,