pub struct Poll {Show 15 fields
pub id: String,
pub question: String,
pub question_entities: Option<Vec<MessageEntity>>,
pub options: Vec<PollOption>,
pub total_voter_count: u32,
pub is_closed: bool,
pub is_anonymous: bool,
pub kind: PollType,
pub allows_multiple_answers: bool,
pub allows_revoting: Option<bool>,
pub correct_option_id: Option<u8>,
pub explanation: Option<String>,
pub explanation_entities: Option<Vec<MessageEntity>>,
pub open_period: Option<u32>,
pub close_date: Option<i64>,
}Expand description
A native Telegram poll or quiz.
Polls are either regular (users vote freely) or quiz (one correct
answer). Returned inside Message when a
poll is sent or forwarded.
Fields§
§id: StringUnique poll identifier.
question: StringPoll question (1–300 characters).
question_entities: Option<Vec<MessageEntity>>Special entities in the question.
options: Vec<PollOption>List of answer options.
total_voter_count: u32Total number of users who voted.
is_closed: booltrue if the poll is closed.
is_anonymous: booltrue if the poll is anonymous.
kind: PollTypePoll type.
allows_multiple_answers: booltrue if the poll allows multiple answers.
allows_revoting: Option<bool>true if voters can change their vote.
correct_option_id: Option<u8>Zero-based index of the correct answer (quiz polls only).
explanation: Option<String>Explanation shown after the quiz is answered.
explanation_entities: Option<Vec<MessageEntity>>Special entities in the explanation.
open_period: Option<u32>Duration in seconds for which the poll will be active after creation.
close_date: Option<i64>Unix timestamp when the poll closes automatically.
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
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