pub enum VoteValue {
Up,
Down,
Ballot(Vec<PollOptionNumber>),
}Expand description
What cast_vote casts: an up- or downvote on a post or comment, or a
ballot in the poll attached to a post.
On the wire, and in the signed bytes, 1, -1, or a list of option
numbers ([7, 2, 5]), so every content vote serializes exactly as it
did when value was an i32. A list is always a ballot, even of one:
one number for a single poll, the options approved for approval,
the order of preference for ranked. Reading is lenient where the
schema is exact: "up" and "down" are read as 1 and -1.
Variants§
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VoteValue
impl<'de> Deserialize<'de> for VoteValue
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for VoteValue
impl StructuralPartialEq for VoteValue
Auto Trait Implementations§
impl Freeze for VoteValue
impl RefUnwindSafe for VoteValue
impl Send for VoteValue
impl Sync for VoteValue
impl Unpin for VoteValue
impl UnsafeUnpin for VoteValue
impl UnwindSafe for VoteValue
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.