pub struct PollBuilder { /* private fields */ }Expand description
Builder for the Poll structure
Implementations§
Source§impl PollBuilder
impl PollBuilder
Sourcepub fn new(
id: String,
question: String,
total_voter_count: i64,
is_closed: bool,
is_anonymous: bool,
_type: PollType,
allows_multiple_answers: bool,
) -> Self
pub fn new( id: String, question: String, total_voter_count: i64, is_closed: bool, is_anonymous: bool, _type: PollType, allows_multiple_answers: bool, ) -> Self
Instantiate the builder with the fields id, question, options, total_voter_count, is_closed, is_anonymous, _type, allows_multiple_answers, correct_option_id, explanation, explanation_entities, open_period, close_date
Sourcepub fn options(self, val: Vec<PollOption>) -> Self
pub fn options(self, val: Vec<PollOption>) -> Self
Set the field options to the given value
Sourcepub fn correct_option_id(self, val: i64) -> Self
pub fn correct_option_id(self, val: i64) -> Self
Set the field correct_option_id to the given value
Sourcepub fn explanation(self, val: String) -> Self
pub fn explanation(self, val: String) -> Self
Set the field explanation to the given value
Sourcepub fn explanation_entities(self, val: Vec<MessageEntity>) -> Self
pub fn explanation_entities(self, val: Vec<MessageEntity>) -> Self
Set the field explanation_entities to the given value
Sourcepub fn open_period(self, val: i64) -> Self
pub fn open_period(self, val: i64) -> Self
Set the field open_period to the given value
Sourcepub fn close_date(self, val: i64) -> Self
pub fn close_date(self, val: i64) -> Self
Set the field close_date to the given value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PollBuilder
impl RefUnwindSafe for PollBuilder
impl Send for PollBuilder
impl Sync for PollBuilder
impl Unpin for PollBuilder
impl UnwindSafe for PollBuilder
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