Struct solana_randomness_service::impls::state::State
source · pub struct State {
pub bump: u8,
pub authority: Pubkey,
pub mint: Pubkey,
pub switchboard_service: Pubkey,
pub wallet: Pubkey,
pub cost_per_byte: u64,
pub last_updated: i64,
pub _ebuf: [u8; 512],
}
Expand description
Program global state for processing randomness requests.
Fields§
§bump: u8
The PDA bump.
The program authority.
mint: Pubkey
The token mint for the program reward.
switchboard_service: Pubkey
The Switchboard Service responsible for responding to randomness requests
wallet: Pubkey
Token wallet used for rewards
cost_per_byte: u64
The cost for each randomness request.
last_updated: i64
The unix timestamp when the cost per byte was last updated.
_ebuf: [u8; 512]
Reserved for future use.
Implementations§
Trait Implementations§
source§impl AccountDeserialize for State
impl AccountDeserialize for State
source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
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§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§impl AccountSerialize for State
impl AccountSerialize for State
source§impl BorshDeserialize for State
impl BorshDeserialize for State
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl Discriminator for State
impl Discriminator for State
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
Auto Trait Implementations§
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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