Struct frankenstein::objects::Poll
source · pub struct Poll {Show 14 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 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
§question_entities: Option<Vec<MessageEntity>>
§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§
source§impl Poll
impl Poll
sourcepub fn builder(
) -> PollBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder( ) -> PollBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Poll
.
On the builder, call .id(...)
, .question(...)
, .question_entities(...)
(optional), .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§
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
source§impl PartialEq for Poll
impl PartialEq for Poll
impl Eq for Poll
impl StructuralPartialEq for Poll
Auto Trait Implementations§
impl Freeze for Poll
impl RefUnwindSafe for Poll
impl Send for Poll
impl Sync for Poll
impl Unpin 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