#[repr(C)]pub struct State {Show 14 fields
pub bump: u8,
pub test_only_disable_mr_enclave_check: u8,
pub authority: Pubkey,
pub guardian_queue: Pubkey,
pub reserved1: u64,
pub epoch_length: u64,
pub current_epoch: StateEpochInfo,
pub next_epoch: StateEpochInfo,
pub finalized_epoch: StateEpochInfo,
pub stake_pool: Pubkey,
pub stake_program: Pubkey,
pub switch_mint: Pubkey,
pub sgx_advisories: [u16; 32],
pub advisories_len: u8,
/* private fields */
}
Fields§
§bump: u8
§test_only_disable_mr_enclave_check: u8
§guardian_queue: Pubkey
§reserved1: u64
§epoch_length: u64
§current_epoch: StateEpochInfo
§next_epoch: StateEpochInfo
§finalized_epoch: StateEpochInfo
§stake_pool: Pubkey
§stake_program: Pubkey
§switch_mint: Pubkey
§sgx_advisories: [u16; 32]
§advisories_len: u8
Implementations§
source§impl State
impl State
pub fn size() -> usize
pub fn get_pda() -> Pubkey
pub fn get_program_pda(program_id: Option<Pubkey>) -> Pubkey
pub async fn fetch_async(client: &RpcClient) -> Result<Self, OnDemandError>
Trait Implementations§
source§impl AccountDeserialize for State
impl AccountDeserialize for State
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§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self, Error>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self, Error>
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 Discriminator for State
impl Discriminator for State
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
impl Copy for State
impl Pod for State
Auto Trait Implementations§
impl Freeze for State
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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