Enum spl_governance::state::proposal::VoteType
source · pub enum VoteType {
SingleChoice,
MultiChoice {
choice_type: MultiChoiceType,
min_voter_options: u8,
max_voter_options: u8,
max_winning_options: u8,
},
}
Expand description
Proposal vote type
Variants§
SingleChoice
Single choice vote with mutually exclusive choices In the SingeChoice mode there can ever be a single winner If multiple options score the same highest vote then the Proposal is not resolved and considered as Failed. Note: Yes/No vote is a single choice (Yes) vote with the deny option (No)
MultiChoice
Fields
§
choice_type: MultiChoiceType
Type of MultiChoice
§
min_voter_options: u8
The min number of options a voter must choose
Note: In the current version the limit is not supported and not enforced and must always be set to 1
Multiple options can be selected with up to max_voter_options per voter and with up to max_winning_options of successful options Ex. voters are given 5 options, can choose up to 3 (max_voter_options) and only 1 (max_winning_options) option can win and be executed
Trait Implementations§
source§impl BorshDeserialize for VoteType
impl BorshDeserialize for VoteType
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSchema for VoteType
impl BorshSchema for VoteType
source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
source§fn 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.
source§fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition>
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition> )
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
source§impl BorshSerialize for VoteType
impl BorshSerialize for VoteType
source§impl PartialEq for VoteType
impl PartialEq for VoteType
impl Eq for VoteType
impl StructuralEq for VoteType
impl StructuralPartialEq for VoteType
Auto Trait Implementations§
impl RefUnwindSafe for VoteType
impl Send for VoteType
impl Sync for VoteType
impl Unpin for VoteType
impl UnwindSafe for VoteType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more