Struct frankenstein::objects::Poll
source · [−]pub struct Poll {Show 13 fields
pub id: String,
pub question: String,
pub options: Vec<PollOption>,
pub total_voter_count: u32,
pub is_closed: bool,
pub is_anonymous: bool,
pub type_field: PollType,
pub allows_multiple_answers: 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<u64>,
}
Fields
id: String
question: String
options: Vec<PollOption>
total_voter_count: u32
is_closed: bool
is_anonymous: bool
type_field: PollType
allows_multiple_answers: bool
correct_option_id: Option<u8>
explanation: Option<String>
explanation_entities: Option<Vec<MessageEntity>>
open_period: Option<u32>
close_date: Option<u64>
Implementations
sourceimpl Poll
impl Poll
sourcepub fn builder(
) -> PollBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder(
) -> PollBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Poll
.
On the builder, call .id(...)
, .question(...)
, .options(...)
, .total_voter_count(...)
, .is_closed(...)
, .is_anonymous(...)
, .type_field(...)
, .allows_multiple_answers(...)
, .correct_option_id(...)
(optional), .explanation(...)
(optional), .explanation_entities(...)
(optional), .open_period(...)
(optional), .close_date(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of Poll
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Poll
impl<'de> Deserialize<'de> for Poll
sourcefn 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 StructuralPartialEq for Poll
Auto Trait Implementations
impl RefUnwindSafe for Poll
impl Send for Poll
impl Sync for Poll
impl Unpin for Poll
impl UnwindSafe for Poll
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more