Struct spl_governance::state::governance::GovernanceV2
source · [−]#[repr(C)]pub struct GovernanceV2 {
pub account_type: GovernanceAccountType,
pub realm: Pubkey,
pub governed_account: Pubkey,
pub proposals_count: u32,
pub config: GovernanceConfig,
pub reserved: [u8; 6],
pub voting_proposal_count: u16,
pub reserved_v2: [u8; 128],
}
Expand description
Governance Account
Fields
account_type: GovernanceAccountType
Account type. It can be Uninitialized, Governance, ProgramGovernance, TokenGovernance or MintGovernance
realm: Pubkey
Governance Realm
governed_account: Pubkey
Account governed by this Governance and/or PDA identity seed It can be Program account, Mint account, Token account or any other account
Note: The account doesn’t have to exist. In that case the field is only a PDA seed
Note: Setting governed_account doesn’t give any authority over the governed account The relevant authorities for specific account types must still be transferred to the Governance PDA Ex: mint_authority/freeze_authority for a Mint account or upgrade_authority for a Program account should be transferred to the Governance PDA
proposals_count: u32
Running count of proposals
config: GovernanceConfig
Governance config
reserved: [u8; 6]
Reserved space for future versions
voting_proposal_count: u16
The number of proposals in voting state in the Governance
reserved_v2: [u8; 128]
Reserved space for versions v2 and onwards Note: This space won’t be available to v1 accounts until runtime supports resizing
Implementations
sourceimpl GovernanceV2
impl GovernanceV2
Trait Implementations
sourceimpl AccountMaxSize for GovernanceV2
impl AccountMaxSize for GovernanceV2
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 GovernanceV2 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
GovernanceConfig: BorshDeserialize,
[u8; 6]: BorshDeserialize,
u16: BorshDeserialize,
[u8; 128]: BorshDeserialize,
impl BorshDeserialize for GovernanceV2 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
GovernanceConfig: BorshDeserialize,
[u8; 6]: BorshDeserialize,
u16: BorshDeserialize,
[u8; 128]: BorshDeserialize,
sourceimpl BorshSchema for GovernanceV2 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u32: BorshSchema,
GovernanceConfig: BorshSchema,
[u8; 6]: BorshSchema,
u16: BorshSchema,
[u8; 128]: BorshSchema,
impl BorshSchema for GovernanceV2 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u32: BorshSchema,
GovernanceConfig: BorshSchema,
[u8; 6]: BorshSchema,
u16: BorshSchema,
[u8; 128]: 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 GovernanceV2 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u32: BorshSerialize,
GovernanceConfig: BorshSerialize,
[u8; 6]: BorshSerialize,
u16: BorshSerialize,
[u8; 128]: BorshSerialize,
impl BorshSerialize for GovernanceV2 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u32: BorshSerialize,
GovernanceConfig: BorshSerialize,
[u8; 6]: BorshSerialize,
u16: BorshSerialize,
[u8; 128]: BorshSerialize,
sourceimpl Clone for GovernanceV2
impl Clone for GovernanceV2
sourcefn clone(&self) -> GovernanceV2
fn clone(&self) -> GovernanceV2
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 GovernanceV2
impl Debug for GovernanceV2
sourceimpl IsInitialized for GovernanceV2
impl IsInitialized for GovernanceV2
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
sourceimpl PartialEq<GovernanceV2> for GovernanceV2
impl PartialEq<GovernanceV2> for GovernanceV2
sourcefn eq(&self, other: &GovernanceV2) -> bool
fn eq(&self, other: &GovernanceV2) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GovernanceV2) -> bool
fn ne(&self, other: &GovernanceV2) -> bool
This method tests for !=
.
impl StructuralPartialEq for GovernanceV2
Auto Trait Implementations
impl RefUnwindSafe for GovernanceV2
impl Send for GovernanceV2
impl Sync for GovernanceV2
impl Unpin for GovernanceV2
impl UnwindSafe for GovernanceV2
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
pub default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more