pub struct CurrentBlockRandomness<T>(/* private fields */);๐Deprecated: Should not be relied upon for correctness, will not provide fresh randomness for the current block. Please use
ParentBlockRandomness instead.Expand description
Randomness produced semi-freshly with each block, but inherits limitations of
RandomnessFromTwoEpochsAgo from which it derives.
Trait Implementationsยง
Sourceยงimpl<T: Config> Randomness<Option<<T as Config>::Hash>, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for CurrentBlockRandomness<T>
impl<T: Config> Randomness<Option<<T as Config>::Hash>, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for CurrentBlockRandomness<T>
Sourceยงfn random(subject: &[u8]) -> (Option<T::Hash>, BlockNumberFor<T>)
fn random(subject: &[u8]) -> (Option<T::Hash>, BlockNumberFor<T>)
Get the most recently determined random seed, along with the time in the past
since when it was determinable by chain observers. Read more
Sourceยงfn random_seed() -> (Output, BlockNumber)
fn random_seed() -> (Output, BlockNumber)
Get the basic random seed. Read more
Auto Trait Implementationsยง
impl<T> Freeze for CurrentBlockRandomness<T>
impl<T> RefUnwindSafe for CurrentBlockRandomness<T>where
T: RefUnwindSafe,
impl<T> Send for CurrentBlockRandomness<T>where
T: Send,
impl<T> Sync for CurrentBlockRandomness<T>where
T: Sync,
impl<T> Unpin for CurrentBlockRandomness<T>where
T: Unpin,
impl<T> UnwindSafe for CurrentBlockRandomness<T>where
T: UnwindSafe,
Blanket Implementationsยง
ยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
ยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยงimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Sourceยงimpl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
Sourceยงfn defensive_truncate_into(self) -> U
fn defensive_truncate_into(self) -> U
Defensively truncate a value and convert it into its bounded form.
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Sourceยงimpl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Sourceยงimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Sourceยงfn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Sourceยงfn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T. Read moreSourceยงimpl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Sourceยงimpl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Sourceยงfn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.Sourceยงimpl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Sourceยงfn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.