Struct spl_governance::state::legacy::GovernanceV1
source · [−]#[repr(C)]pub struct GovernanceV1 {
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,
}
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 Note: This is field introduced in V2 but it took space from reserved and we have preserve it for V1 serialization roundtrip
Trait Implementations
sourceimpl BorshDeserialize for GovernanceV1 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
GovernanceConfig: BorshDeserialize,
[u8; 6]: BorshDeserialize,
u16: BorshDeserialize,
impl BorshDeserialize for GovernanceV1 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
GovernanceConfig: BorshDeserialize,
[u8; 6]: BorshDeserialize,
u16: BorshDeserialize,
sourceimpl BorshSchema for GovernanceV1 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u32: BorshSchema,
GovernanceConfig: BorshSchema,
[u8; 6]: BorshSchema,
u16: BorshSchema,
impl BorshSchema for GovernanceV1 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u32: BorshSchema,
GovernanceConfig: BorshSchema,
[u8; 6]: BorshSchema,
u16: 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 GovernanceV1 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u32: BorshSerialize,
GovernanceConfig: BorshSerialize,
[u8; 6]: BorshSerialize,
u16: BorshSerialize,
impl BorshSerialize for GovernanceV1 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u32: BorshSerialize,
GovernanceConfig: BorshSerialize,
[u8; 6]: BorshSerialize,
u16: BorshSerialize,
sourceimpl Clone for GovernanceV1
impl Clone for GovernanceV1
sourcefn clone(&self) -> GovernanceV1
fn clone(&self) -> GovernanceV1
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 GovernanceV1
impl Debug for GovernanceV1
sourceimpl IsInitialized for GovernanceV1
impl IsInitialized for GovernanceV1
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
sourceimpl PartialEq<GovernanceV1> for GovernanceV1
impl PartialEq<GovernanceV1> for GovernanceV1
sourcefn eq(&self, other: &GovernanceV1) -> bool
fn eq(&self, other: &GovernanceV1) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GovernanceV1) -> bool
fn ne(&self, other: &GovernanceV1) -> bool
This method tests for !=
.
impl StructuralPartialEq for GovernanceV1
Auto Trait Implementations
impl RefUnwindSafe for GovernanceV1
impl Send for GovernanceV1
impl Sync for GovernanceV1
impl Unpin for GovernanceV1
impl UnwindSafe for GovernanceV1
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