pub enum RandomnessAccountData {
V1(Randomness),
V2(RandomnessV2),
}
Expand description
Data of a supported randomness account.
Variants§
V1(Randomness)
V2(RandomnessV2)
Implementations§
source§impl RandomnessAccountData
impl RandomnessAccountData
sourcepub const fn client(&self) -> Option<&Pubkey>
pub const fn client(&self) -> Option<&Pubkey>
Returns the request client.
Return None
for V1 accounts.
sourcepub fn responses(&self) -> Option<&[RandomnessResponse]>
pub fn responses(&self) -> Option<&[RandomnessResponse]>
Returns randomness responses collected so far.
Returns None
for fulfilled V2 accounts.
sourcepub const fn fulfilled_randomness(&self) -> Option<&[u8; 64]>
pub const fn fulfilled_randomness(&self) -> Option<&[u8; 64]>
Returns the fulfilled randomness.
Returns None
if randomness is pending.
sourcepub const fn version(&self) -> RandomnessAccountVersion
pub const fn version(&self) -> RandomnessAccountVersion
Returns account data version.
Trait Implementations§
source§impl AccountDeserialize for RandomnessAccountData
impl AccountDeserialize for RandomnessAccountData
source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed.
source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint
account into a token
Account
.source§impl Clone for RandomnessAccountData
impl Clone for RandomnessAccountData
source§fn clone(&self) -> RandomnessAccountData
fn clone(&self) -> RandomnessAccountData
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 moreAuto Trait Implementations§
impl Freeze for RandomnessAccountData
impl RefUnwindSafe for RandomnessAccountData
impl Send for RandomnessAccountData
impl Sync for RandomnessAccountData
impl Unpin for RandomnessAccountData
impl UnwindSafe for RandomnessAccountData
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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 more