pub struct MockUpdatePoll {Show 14 fields
pub poll_id: PollId,
pub question: String,
pub question_entities: Option<Vec<MessageEntity>>,
pub options: Vec<PollOption>,
pub is_closed: bool,
pub total_voter_count: u32,
pub is_anonymous: bool,
pub poll_type: 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<Seconds>,
pub close_date: Option<DateTime<Utc>>,
}Fields§
§poll_id: PollId§question: String§question_entities: Option<Vec<MessageEntity>>§options: Vec<PollOption>§is_closed: bool§total_voter_count: u32§is_anonymous: bool§poll_type: PollType§allows_multiple_answers: bool§correct_option_id: Option<u8>§explanation: Option<String>§explanation_entities: Option<Vec<MessageEntity>>§open_period: Option<Seconds>§close_date: Option<DateTime<Utc>>Implementations§
Source§impl MockUpdatePoll
impl MockUpdatePoll
Sourcepub fn poll_id(self, value: PollId) -> Self
pub fn poll_id(self, value: PollId) -> Self
Sets the poll_id value of the MockUpdatePoll to value.
Sourcepub fn question<T: Into<String>>(self, value: T) -> Self
pub fn question<T: Into<String>>(self, value: T) -> Self
Sets the question value of the MockUpdatePoll to value, converting it to String.
§Example
use teloxide_tests::MockUpdatePoll;
let builder = MockUpdatePoll::new().question("test");
assert_eq!(builder.question, "test".to_string());Sourcepub fn question_entities<T: Into<Vec<MessageEntity>>>(self, value: T) -> Self
pub fn question_entities<T: Into<Vec<MessageEntity>>>(self, value: T) -> Self
Sets the question_entities value of the MockUpdatePoll to value, converting it to needed Option type.
Sourcepub fn options(self, value: Vec<PollOption>) -> Self
pub fn options(self, value: Vec<PollOption>) -> Self
Sets the options value of the MockUpdatePoll to value.
Sourcepub fn is_closed(self, value: bool) -> Self
pub fn is_closed(self, value: bool) -> Self
Sets the is_closed value of the MockUpdatePoll to value.
Sourcepub fn total_voter_count(self, value: u32) -> Self
pub fn total_voter_count(self, value: u32) -> Self
Sets the total_voter_count value of the MockUpdatePoll to value.
Sourcepub fn is_anonymous(self, value: bool) -> Self
pub fn is_anonymous(self, value: bool) -> Self
Sets the is_anonymous value of the MockUpdatePoll to value.
Sourcepub fn poll_type(self, value: PollType) -> Self
pub fn poll_type(self, value: PollType) -> Self
Sets the poll_type value of the MockUpdatePoll to value.
Sourcepub fn allows_multiple_answers(self, value: bool) -> Self
pub fn allows_multiple_answers(self, value: bool) -> Self
Sets the allows_multiple_answers value of the MockUpdatePoll to value.
Sourcepub fn correct_option_id<T: Into<u8>>(self, value: T) -> Self
pub fn correct_option_id<T: Into<u8>>(self, value: T) -> Self
Sets the correct_option_id value of the MockUpdatePoll to value, converting it to needed Option type.
Sourcepub fn explanation<T: Into<String>>(self, value: T) -> Self
pub fn explanation<T: Into<String>>(self, value: T) -> Self
Sets the explanation value of the MockUpdatePoll to value, converting it to needed Option type.
Sourcepub fn explanation_entities<T: Into<Vec<MessageEntity>>>(self, value: T) -> Self
pub fn explanation_entities<T: Into<Vec<MessageEntity>>>(self, value: T) -> Self
Sets the explanation_entities value of the MockUpdatePoll to value, converting it to needed Option type.
Sourcepub fn open_period<T: Into<Seconds>>(self, value: T) -> Self
pub fn open_period<T: Into<Seconds>>(self, value: T) -> Self
Sets the open_period value of the MockUpdatePoll to value, converting it to needed Option type.
Sourcepub fn close_date<T: Into<DateTime<Utc>>>(self, value: T) -> Self
pub fn close_date<T: Into<DateTime<Utc>>>(self, value: T) -> Self
Sets the close_date value of the MockUpdatePoll to value, converting it to needed Option type.
Trait Implementations§
Source§impl Clone for MockUpdatePoll
impl Clone for MockUpdatePoll
Source§fn clone(&self) -> MockUpdatePoll
fn clone(&self) -> MockUpdatePoll
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl IntoUpdate for MockUpdatePoll
impl IntoUpdate for MockUpdatePoll
Auto Trait Implementations§
impl Freeze for MockUpdatePoll
impl RefUnwindSafe for MockUpdatePoll
impl Send for MockUpdatePoll
impl Sync for MockUpdatePoll
impl Unpin for MockUpdatePoll
impl UnwindSafe for MockUpdatePoll
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for 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