Struct spl_governance::state::token_owner_record::TokenOwnerRecord[][src]

#[repr(C)]
pub struct TokenOwnerRecord { pub account_type: GovernanceAccountType, pub realm: Pubkey, pub governing_token_mint: Pubkey, pub governing_token_owner: Pubkey, pub governing_token_deposit_amount: u64, pub unrelinquished_votes_count: u32, pub total_votes_count: u32, pub reserved: [u8; 8], pub governance_delegate: Option<Pubkey>, }
Expand description

Governance Token Owner Record Account PDA seeds: [‘governance’, realm, token_mint, token_owner ]

Fields

account_type: GovernanceAccountType

Governance account type

realm: Pubkey

The Realm the TokenOwnerRecord belongs to

governing_token_mint: Pubkey

Governing Token Mint the TokenOwnerRecord holds deposit for

governing_token_owner: Pubkey

The owner (either single or multisig) of the deposited governing SPL Tokens This is who can authorize a withdrawal of the tokens

governing_token_deposit_amount: u64

The amount of governing tokens deposited into the Realm This amount is the voter weight used when voting on proposals

unrelinquished_votes_count: u32

The number of votes cast by TokenOwner but not relinquished yet Every time a vote is cast this number is increased and it’s always decreased when relinquishing a vote regardless of the vote state

total_votes_count: u32

The total number of votes cast by the TokenOwner If TokenOwner withdraws vote while voting is still in progress total_votes_count is decreased and the vote doesn’t count towards the total

reserved: [u8; 8]

Reserved space for future versions

governance_delegate: Option<Pubkey>

A single account that is allowed to operate governance with the deposited governing tokens It can be delegated to by the governing_token_owner or current governance_delegate

Implementations

Checks whether the provided Governance Authority signed transaction

Trait Implementations

Returns max account size or None if max size is not known and actual instance size should be used

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more

Deserialize this instance from a slice of bytes.

Whether Self is u8. NOTE: Vec<u8> is the most common use-case for serialization and deserialization, it’s worth handling it as a special case to improve performance. It’s a workaround for specific Vec<u8> implementation versus generic Vec<T> implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details. Read more

Get the name of the type without brackets.

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

Helper method to add a single type definition to the map.

Serialize this instance into a vector of bytes.

Whether Self is u8. NOTE: Vec<u8> is the most common use-case for serialization and deserialization, it’s worth handling it as a special case to improve performance. It’s a workaround for specific Vec<u8> implementation versus generic Vec<T> implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Is initialized

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.