Enum spl_governance::state::enums::VoteThresholdPercentage
source · [−]Expand description
The type of the vote threshold percentage used to resolve a vote on a Proposal
Variants
YesVote(u8)
Voting threshold of Yes votes in % required to tip the vote It’s the percentage of tokens out of the entire pool of governance tokens eligible to vote Note: If the threshold is below or equal to 50% then an even split of votes ex: 50:50 or 40:40 is always resolved as Defeated In other words a ‘+1 vote’ tie breaker is always required to have a successful vote
Quorum(u8)
The minimum number of votes in % out of the entire pool of governance tokens eligible to vote which must be cast for the vote to be valid Once the quorum is achieved a simple majority (50%+1) of Yes votes is required for the vote to succeed Note: Quorum is not implemented in the current version
Trait Implementations
sourceimpl BorshDeserialize for VoteThresholdPercentage where
u8: BorshDeserialize,
u8: BorshDeserialize,
impl BorshDeserialize for VoteThresholdPercentage where
u8: BorshDeserialize,
u8: BorshDeserialize,
sourceimpl BorshSchema for VoteThresholdPercentage
impl BorshSchema for VoteThresholdPercentage
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 VoteThresholdPercentage where
u8: BorshSerialize,
u8: BorshSerialize,
impl BorshSerialize for VoteThresholdPercentage where
u8: BorshSerialize,
u8: BorshSerialize,
sourceimpl Clone for VoteThresholdPercentage
impl Clone for VoteThresholdPercentage
sourcefn clone(&self) -> VoteThresholdPercentage
fn clone(&self) -> VoteThresholdPercentage
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 VoteThresholdPercentage
impl Debug for VoteThresholdPercentage
sourceimpl PartialEq<VoteThresholdPercentage> for VoteThresholdPercentage
impl PartialEq<VoteThresholdPercentage> for VoteThresholdPercentage
sourcefn eq(&self, other: &VoteThresholdPercentage) -> bool
fn eq(&self, other: &VoteThresholdPercentage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VoteThresholdPercentage) -> bool
fn ne(&self, other: &VoteThresholdPercentage) -> bool
This method tests for !=
.
impl StructuralPartialEq for VoteThresholdPercentage
Auto Trait Implementations
impl RefUnwindSafe for VoteThresholdPercentage
impl Send for VoteThresholdPercentage
impl Sync for VoteThresholdPercentage
impl Unpin for VoteThresholdPercentage
impl UnwindSafe for VoteThresholdPercentage
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