Struct spl_governance::state::vote_record::VoteRecordV2
source · [−]pub struct VoteRecordV2 {
pub account_type: GovernanceAccountType,
pub proposal: Pubkey,
pub governing_token_owner: Pubkey,
pub is_relinquished: bool,
pub voter_weight: u64,
pub vote: Vote,
pub reserved_v2: [u8; 8],
}
Expand description
Proposal VoteRecord
Fields
account_type: GovernanceAccountType
Governance account type
proposal: Pubkey
Proposal account
governing_token_owner: Pubkey
The user who casted this vote This is the Governing Token Owner who deposited governing tokens into the Realm
is_relinquished: bool
Indicates whether the vote was relinquished by voter
voter_weight: u64
The weight of the user casting the vote
vote: Vote
Voter’s vote
reserved_v2: [u8; 8]
Reserved space for versions v2 and onwards Note: This space won’t be available to v1 accounts until runtime supports resizing
Implementations
sourceimpl VoteRecordV2
impl VoteRecordV2
sourcepub fn assert_can_relinquish_vote(&self) -> Result<(), ProgramError>
pub fn assert_can_relinquish_vote(&self) -> Result<(), ProgramError>
Checks the vote can be relinquished
Trait Implementations
sourceimpl AccountMaxSize for VoteRecordV2
impl AccountMaxSize for VoteRecordV2
sourcefn get_max_size(&self) -> Option<usize>
fn get_max_size(&self) -> Option<usize>
Returns max account size or None if max size is not known and actual instance size should be used
sourceimpl BorshDeserialize for VoteRecordV2 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
bool: BorshDeserialize,
u64: BorshDeserialize,
Vote: BorshDeserialize,
[u8; 8]: BorshDeserialize,
impl BorshDeserialize for VoteRecordV2 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
bool: BorshDeserialize,
u64: BorshDeserialize,
Vote: BorshDeserialize,
[u8; 8]: BorshDeserialize,
sourceimpl BorshSchema for VoteRecordV2 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
bool: BorshSchema,
u64: BorshSchema,
Vote: BorshSchema,
[u8; 8]: BorshSchema,
impl BorshSchema for VoteRecordV2 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
bool: BorshSchema,
u64: BorshSchema,
Vote: BorshSchema,
[u8; 8]: BorshSchema,
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more
sourcefn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
sourceimpl BorshSerialize for VoteRecordV2 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
bool: BorshSerialize,
u64: BorshSerialize,
Vote: BorshSerialize,
[u8; 8]: BorshSerialize,
impl BorshSerialize for VoteRecordV2 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
bool: BorshSerialize,
u64: BorshSerialize,
Vote: BorshSerialize,
[u8; 8]: BorshSerialize,
sourceimpl Clone for VoteRecordV2
impl Clone for VoteRecordV2
sourcefn clone(&self) -> VoteRecordV2
fn clone(&self) -> VoteRecordV2
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 VoteRecordV2
impl Debug for VoteRecordV2
sourceimpl IsInitialized for VoteRecordV2
impl IsInitialized for VoteRecordV2
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
sourceimpl PartialEq<VoteRecordV2> for VoteRecordV2
impl PartialEq<VoteRecordV2> for VoteRecordV2
sourcefn eq(&self, other: &VoteRecordV2) -> bool
fn eq(&self, other: &VoteRecordV2) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VoteRecordV2) -> bool
fn ne(&self, other: &VoteRecordV2) -> bool
This method tests for !=
.
impl StructuralPartialEq for VoteRecordV2
Auto Trait Implementations
impl RefUnwindSafe for VoteRecordV2
impl Send for VoteRecordV2
impl Sync for VoteRecordV2
impl Unpin for VoteRecordV2
impl UnwindSafe for VoteRecordV2
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
impl<T> Pointable for T
impl<T> Pointable for T
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