pub struct Poll {Show 21 fields
pub id: PollId,
pub question: String,
pub question_entities: Option<Vec<MessageEntity>>,
pub options: Vec<PollOption>,
pub is_closed: bool,
pub total_voter_count: u32,
pub is_anonymous: bool,
pub poll_type: PollType,
pub allows_multiple_answers: bool,
pub allows_revoting: bool,
pub correct_option_ids: Option<Vec<u8>>,
pub explanation: Option<String>,
pub explanation_entities: Option<Vec<MessageEntity>>,
pub open_period: Option<Seconds>,
pub close_date: Option<DateTime<Utc>>,
pub description: Option<String>,
pub description_entities: Option<Vec<MessageEntity>>,
pub members_only: bool,
pub country_codes: Option<Vec<String>>,
pub explanation_media: Option<PollMedia>,
pub media: Option<PollMedia>,
}Expand description
This object contains information about a poll.
Fields§
§id: PollIdUnique poll identifier.
question: StringPoll question, 1-300 characters.
question_entities: Option<Vec<MessageEntity>>Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
options: Vec<PollOption>List of poll options.
is_closed: booltrue, if the poll is closed.
total_voter_count: u32Total number of users that voted in the poll
is_anonymous: boolTrue, if the poll is anonymous
poll_type: PollTypePoll type, currently can be “regular” or “quiz”
allows_multiple_answers: boolTrue, if the poll allows multiple answers
allows_revoting: booltrue, if the poll allows to change the chosen answer options.
correct_option_ids: Option<Vec<u8>>0-based identifiers of the correct answer options. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
explanation: Option<String>Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters.
explanation_entities: Option<Vec<MessageEntity>>Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
open_period: Option<Seconds>Amount of time in seconds the poll will be active after creation.
close_date: Option<DateTime<Utc>>Point in time when the poll will be automatically closed.
description: Option<String>Description of the poll; for polls inside the Message object only.
description_entities: Option<Vec<MessageEntity>>Special entities that appear in the description.
members_only: booltrue, if the poll is available only to chat members.
country_codes: Option<Vec<String>>ISO 3166-1 alpha-2 country codes of countries where the poll is available.
explanation_media: Option<PollMedia>Media accompanying the poll explanation.
media: Option<PollMedia>Media accompanying the poll.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Poll
impl<'de> Deserialize<'de> for Poll
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Poll, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Poll, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Poll
impl Serialize for Poll
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Poll
Auto Trait Implementations§
impl Forget for Poll
impl Freeze for Pollwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<MessageEntity>: Freeze,
PhantomData<PollOption>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
PhantomData<String>: Freeze,
&'static str: Freeze,
PhantomData<(Indexed, Indexed)>: Freeze,
PhantomData<PhotoSize>: Freeze,
PhantomData<VideoQuality>: Freeze,
impl Move for Poll
impl RefUnwindSafe for Poll
impl Send for Poll
impl Sync for Poll
impl Unpin for Poll
impl UnsafeUnpin for Pollwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<MessageEntity>: UnsafeUnpin,
PhantomData<PollOption>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
&'static str: UnsafeUnpin,
PhantomData<(Indexed, Indexed)>: UnsafeUnpin,
PhantomData<PhotoSize>: UnsafeUnpin,
PhantomData<VideoQuality>: UnsafeUnpin,
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
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<T> Erasable for T
impl<T> Erasable for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more