pub struct Poll {
pub options: HashMap<PollOptionID, PollOption>,
pub order: Vec<PollOptionID>,
}Expand description
Poll state reconstructed from poll and vote payloads.
Fields§
§options: HashMap<PollOptionID, PollOption>Options keyed by poll option identifier.
order: Vec<PollOptionID>Option identifiers in display order.
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 the initial poll payload.
Sourcepub fn count_votes(&mut self, payload: &Value) -> Result<(), PlistParseError>
pub fn count_votes(&mut self, payload: &Value) -> Result<(), PlistParseError>
Apply a vote payload to 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 UnsafeUnpin 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.