Struct gauge::EpochGauge
source · [−]Expand description
An EpochGauge is a Gauge’s total committed votes for a given epoch.
Seeds:
[
b"EpochGauge".as_ref(),
gauge.key().as_ref(),
voting_epoch.to_le_bytes().as_ref()
],
Fields
gauge: Pubkey
The Gauge.
voting_epoch: u32
The epoch associated with this EpochGauge.
total_power: u64
The total number of power to be applied to the latest voted epoch. If this number is non-zero, vote weights cannot be changed until they are all withdrawn.
Implementations
sourceimpl EpochGauge
impl EpochGauge
sourcepub const LEN: usize = 44usize
pub const LEN: usize = 44usize
Length of an EpochGauge in bytes.
Trait Implementations
sourceimpl AccountDeserialize for EpochGauge
impl AccountDeserialize for EpochGauge
sourcefn 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
. Read more
sourceimpl AccountSerialize for EpochGauge
impl AccountSerialize for EpochGauge
sourceimpl BorshDeserialize for EpochGauge where
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
impl BorshDeserialize for EpochGauge where
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
sourceimpl BorshSerialize for EpochGauge where
Pubkey: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
impl BorshSerialize for EpochGauge where
Pubkey: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
sourceimpl Clone for EpochGauge
impl Clone for EpochGauge
sourcefn clone(&self) -> EpochGauge
fn clone(&self) -> EpochGauge
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for EpochGauge
impl Debug for EpochGauge
sourceimpl Default for EpochGauge
impl Default for EpochGauge
sourcefn default() -> EpochGauge
fn default() -> EpochGauge
Returns the “default value” for a type. Read more
sourceimpl Discriminator for EpochGauge
impl Discriminator for EpochGauge
fn discriminator() -> [u8; 8]
sourceimpl Owner for EpochGauge
impl Owner for EpochGauge
impl Copy for EpochGauge
Auto Trait Implementations
impl RefUnwindSafe for EpochGauge
impl Send for EpochGauge
impl Sync for EpochGauge
impl Unpin for EpochGauge
impl UnwindSafe for EpochGauge
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more