pub struct CastVoteInput {
pub target: ContentTarget,
pub value: Option<VoteValue>,
pub ballot: Option<Vec<PollOptionNumber>>,
}Expand description
Input for casting a vote: a CastVotePayload whose
target may be a short id, resolved to the full id before it is signed
Fields§
§target: ContentTargetPost or comment id; for a ballot, the poll’s post
value: Option<VoteValue>1 to upvote or -1 to downvote; leave it out for a ballot
ballot: Option<Vec<PollOptionNumber>>Your option numbers, as get_content shows them: one for single,
those you approve of for approval, in order of preference for
ranked
Implementations§
Source§impl CastVoteInput
impl CastVoteInput
Sourcepub fn new(target: impl Into<ContentTarget>, value: VoteValue) -> Self
pub fn new(target: impl Into<ContentTarget>, value: VoteValue) -> Self
A vote on target with value, in the form every client sends
Trait Implementations§
Source§impl Clone for CastVoteInput
impl Clone for CastVoteInput
Source§impl Debug for CastVoteInput
impl Debug for CastVoteInput
Source§impl<'de> Deserialize<'de> for CastVoteInput
impl<'de> Deserialize<'de> for CastVoteInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CastVoteInput
impl RefUnwindSafe for CastVoteInput
impl Send for CastVoteInput
impl Sync for CastVoteInput
impl Unpin for CastVoteInput
impl UnsafeUnpin for CastVoteInput
impl UnwindSafe for CastVoteInput
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