pub struct Quiz {
pub correct_option_id: i64,
pub id: String,
pub is_anonymous: bool,
pub is_closed: bool,
pub options: Vec<PollOption>,
pub question: Text,
pub total_voter_count: i64,
pub close_date: Option<i64>,
pub explanation: Option<Text>,
pub open_period: Option<i64>,
}
Expand description
Represents a quiz.
Fields§
§correct_option_id: i64
0-based identifier of the correct answer option.
Available only for a closed quiz, or was sent (not forwarded) by the bot or to the private chat with the bot.
id: String
Unique identifier of the quiz.
is_anonymous: bool
Indicates whether the quiz is anonymous.
is_closed: bool
Indicates whether the quiz is closed.
options: Vec<PollOption>
List of options.
question: Text
Question; 1-255 characters.
total_voter_count: i64
Total number of users that answered to the quiz.
close_date: Option<i64>
Point in time (Unix timestamp) when the quiz will be automatically closed.
explanation: Option<Text>
Text that is shown when a user chooses an incorrect answer or taps on the lamp icon; 0-200 characters.
open_period: Option<i64>
Amount of time in seconds the quiz will be active after creation.
Implementations§
source§impl Quiz
impl Quiz
sourcepub fn with_close_date(self, value: i64) -> Quiz
pub fn with_close_date(self, value: i64) -> Quiz
Sets a new close date.
§Arguments
value
- Point in time (Unix timestamp) when the quiz will be automatically closed.
sourcepub fn with_correct_option_id(self, value: i64) -> Quiz
pub fn with_correct_option_id(self, value: i64) -> Quiz
sourcepub fn with_explanation<T>(self, value: T) -> Quiz
pub fn with_explanation<T>(self, value: T) -> Quiz
Sets a new explanation.
§Arguments
value
- Text that is shown when a user chooses an incorrect answer or taps on the lamp icon; 0-200 characters.
sourcepub fn with_is_anonymous(self, value: bool) -> Quiz
pub fn with_is_anonymous(self, value: bool) -> Quiz
Sets a new value for the is_anonymous
flag.
§Arguments
value
- Indicates whether the quiz is anonymous.
sourcepub fn with_is_closed(self, value: bool) -> Quiz
pub fn with_is_closed(self, value: bool) -> Quiz
sourcepub fn with_open_period(self, value: i64) -> Quiz
pub fn with_open_period(self, value: i64) -> Quiz
Sets a new open period.
§Arguments
value
- Amount of time in seconds the quiz will be active after creation.
sourcepub fn with_options<T>(self, value: T) -> Quizwhere
T: IntoIterator<Item = PollOption>,
pub fn with_options<T>(self, value: T) -> Quizwhere
T: IntoIterator<Item = PollOption>,
sourcepub fn with_total_voter_count(self, value: i64) -> Quiz
pub fn with_total_voter_count(self, value: i64) -> Quiz
Sets a new correct total voter count.
§Arguments
value
- Total number of users that answered to the quiz.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Quiz
impl<'de> Deserialize<'de> for Quiz
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Quiz, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Quiz, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Quiz
impl PartialEq for Quiz
source§impl PartialOrd for Quiz
impl PartialOrd for Quiz
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Quiz
impl Serialize for Quiz
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 Quiz
Auto Trait Implementations§
impl Freeze for Quiz
impl RefUnwindSafe for Quiz
impl Send for Quiz
impl Sync for Quiz
impl Unpin for Quiz
impl UnwindSafe for Quiz
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
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