pub struct Poll {
pub options: HashMap<PollOptionID, PollOption>,
pub order: Vec<PollOptionID>,
}Expand description
Represents a Poll message
Fields§
§options: HashMap<PollOptionID, PollOption>Map of option ID to PollOption
order: Vec<PollOptionID>The order of the options as they were created
Implementations§
Source§impl Poll
impl Poll
Sourcepub fn from_payload(payload: &Value) -> Result<Self, PlistParseError>
pub fn from_payload(payload: &Value) -> Result<Self, PlistParseError>
Parse a Poll from the given payload
Sourcepub fn count_votes(&mut self, payload: &Value) -> Result<(), PlistParseError>
pub fn count_votes(&mut self, payload: &Value) -> Result<(), PlistParseError>
Count votes from a vote payload and update the poll options
Trait Implementations§
impl Eq for Poll
impl StructuralPartialEq for Poll
Auto Trait Implementations§
impl Freeze for Poll
impl RefUnwindSafe for Poll
impl Send for Poll
impl Sync for Poll
impl Unpin for Poll
impl UnwindSafe for Poll
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.