pub struct RegularPoll {
pub allows_multiple_answers: bool,
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 open_period: Option<Integer>,
}Expand description
Represents a regular poll.
Fields§
§allows_multiple_answers: boolIndicates whether the poll allows multiple answers.
id: StringUnique identifier of the poll.
is_anonymous: boolIndicates whether the poll is anonymous.
is_closed: boolIndicates whether the poll is closed.
options: Vec<PollOption>List of options.
question: TextQuestion; 1-255 characters.
total_voter_count: IntegerTotal number of users that voted in the poll.
close_date: Option<Integer>Point in time (Unix timestamp) when the poll will be automatically closed.
open_period: Option<Integer>Amount of time in seconds the poll will be active after creation.
Implementations§
Source§impl RegularPoll
impl RegularPoll
Sourcepub fn new<A, B>(id: A, question: B) -> Self
pub fn new<A, B>(id: A, question: B) -> Self
Creates a new RegularPoll.
§Arguments
id- Unique identifier.question- Question; 1-255 characters.
Sourcepub fn with_allows_multiple_answers(self, value: bool) -> Self
pub fn with_allows_multiple_answers(self, value: bool) -> Self
Sets a new value for the allows_multiple_answers flag.
§Arguments
value- Indicates whether the poll allows multiple answers.
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 poll will be automatically closed.
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 poll 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 Clone for RegularPoll
impl Clone for RegularPoll
Source§fn clone(&self) -> RegularPoll
fn clone(&self) -> RegularPoll
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegularPoll
impl Debug for RegularPoll
Source§impl<'de> Deserialize<'de> for RegularPoll
impl<'de> Deserialize<'de> for RegularPoll
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 From<RegularPoll> for Poll
impl From<RegularPoll> for Poll
Source§fn from(value: RegularPoll) -> Self
fn from(value: RegularPoll) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RegularPoll
impl PartialEq for RegularPoll
Source§impl PartialOrd for RegularPoll
impl PartialOrd for RegularPoll
Source§impl Serialize for RegularPoll
impl Serialize for RegularPoll
impl StructuralPartialEq for RegularPoll
Auto Trait Implementations§
impl Freeze for RegularPoll
impl RefUnwindSafe for RegularPoll
impl Send for RegularPoll
impl Sync for RegularPoll
impl Unpin for RegularPoll
impl UnwindSafe for RegularPoll
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