Struct carapax::types::RegularPoll
source · 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: i64,
pub close_date: Option<i64>,
pub open_period: Option<i64>,
}
Expand description
Represents a regular poll.
Fields§
§allows_multiple_answers: bool
Indicates whether the poll allows multiple answers.
id: String
Unique identifier of the poll.
is_anonymous: bool
Indicates whether the poll is anonymous.
is_closed: bool
Indicates whether the poll is closed.
options: Vec<PollOption>
List of options.
question: Text
Question; 1-255 characters.
total_voter_count: i64
Total number of users that voted in the poll.
close_date: Option<i64>
Point in time (Unix timestamp) when the poll will be automatically closed.
open_period: Option<i64>
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) -> RegularPoll
pub fn new<A, B>(id: A, question: B) -> RegularPoll
Creates a new RegularPoll
.
§Arguments
id
- Unique identifier.question
- Question; 1-255 characters.
sourcepub fn with_allows_multiple_answers(self, value: bool) -> RegularPoll
pub fn with_allows_multiple_answers(self, value: bool) -> RegularPoll
Sets a new value for an allows_multiple_answers
flag.
§Arguments
value
- Indicates whether the poll allows multiple answers.
sourcepub fn with_close_date(self, value: i64) -> RegularPoll
pub fn with_close_date(self, value: i64) -> RegularPoll
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) -> RegularPoll
pub fn with_is_anonymous(self, value: bool) -> RegularPoll
Sets a new value for an is_anonymous
flag.
§Arguments
value
- Indicates whether the quiz is anonymous.
sourcepub fn with_is_closed(self, value: bool) -> RegularPoll
pub fn with_is_closed(self, value: bool) -> RegularPoll
sourcepub fn with_open_period(self, value: i64) -> RegularPoll
pub fn with_open_period(self, value: i64) -> RegularPoll
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) -> RegularPollwhere
T: IntoIterator<Item = PollOption>,
pub fn with_options<T>(self, value: T) -> RegularPollwhere
T: IntoIterator<Item = PollOption>,
sourcepub fn with_total_voter_count(self, value: i64) -> RegularPoll
pub fn with_total_voter_count(self, value: i64) -> RegularPoll
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 copy 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<RegularPoll, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<RegularPoll, <__D as Deserializer<'de>>::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(original: RegularPoll) -> Poll
fn from(original: RegularPoll) -> Poll
Converts to this type from the input type.
source§impl PartialEq for RegularPoll
impl PartialEq for RegularPoll
source§fn eq(&self, other: &RegularPoll) -> bool
fn eq(&self, other: &RegularPoll) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RegularPoll
impl PartialOrd for RegularPoll
source§fn partial_cmp(&self, other: &RegularPoll) -> Option<Ordering>
fn partial_cmp(&self, other: &RegularPoll) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RegularPoll
impl Serialize for RegularPoll
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
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>
Converts
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>
Converts
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