pub struct Quiz {
pub correct_option_id: Integer,
pub id: String,
pub is_anonymous: bool,
pub is_closed: bool,
pub options: Vec<PollOption>,
pub question: Text,
pub total_voter_count: Integer,
pub close_date: Option<Integer>,
pub explanation: Option<Text>,
pub open_period: Option<Integer>,
}
Expand description
Represents a quiz.
Fields§
§correct_option_id: Integer
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: Integer
Total number of users that answered to the quiz.
close_date: Option<Integer>
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<Integer>
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: Integer) -> Self
pub fn with_close_date(self, value: Integer) -> Self
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: Integer) -> Self
pub fn with_correct_option_id(self, value: Integer) -> Self
sourcepub fn with_explanation<T>(self, value: T) -> Self
pub fn with_explanation<T>(self, value: T) -> Self
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) -> Self
pub fn with_is_anonymous(self, value: bool) -> Self
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) -> Self
pub fn with_is_closed(self, value: bool) -> Self
sourcepub fn with_open_period(self, value: Integer) -> Self
pub fn with_open_period(self, value: Integer) -> Self
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) -> Selfwhere
T: IntoIterator<Item = PollOption>,
pub fn with_options<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = PollOption>,
sourcepub fn with_total_voter_count(self, value: Integer) -> Self
pub fn with_total_voter_count(self, value: Integer) -> Self
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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 moreimpl 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