#[non_exhaustive]pub struct Poll {
pub question: Media,
pub answers: Vec<Answer>,
pub expiry: Option<Timestamp>,
pub allow_multiselect: bool,
pub layout_type: LayoutType,
pub results: Option<Results>,
}Expand description
A poll.
discord.js counterpart: Poll.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.question: MediaThe question (only text is supported).
answers: Vec<Answer>The answers to choose from.
expiry: Option<Timestamp>When the poll ends. Discord documents it as nullable for polls that may never expire, although currently every poll has an expiry.
allow_multiselect: boolWhether a user can choose several answers.
layout_type: LayoutTypeHow the poll is displayed.
results: Option<Results>The vote counts. None means unknown results, not no votes: some responses omit
them because Discord did not fetch them (results received earlier stay valid). Ended
polls always have results.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Poll
impl<'de> Deserialize<'de> for Poll
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
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