pub struct PollOption {
pub persistent_id: String,
pub text: Text,
pub voter_count: Integer,
pub added_by_chat: Option<Chat>,
pub added_by_user: Option<User>,
pub addition_date: Option<Integer>,
pub media: Option<PollMedia>,
}Expand description
Represents an answer option in a poll.
Fields§
§persistent_id: StringUnique identifier of the option, persistent on option addition and deletion.
text: TextOption text; 1-100 characters.
voter_count: IntegerNumber of users that voted for this option.
added_by_chat: Option<Chat>Chat that added the option.
Omitted if the option wasn’t added by a chat after poll creation.
added_by_user: Option<User>User who added the option.
Omitted if the option wasn’t added by a user after poll creation.
addition_date: Option<Integer>Point in time (Unix timestamp) when the option was added.
Omitted if the option existed in the original poll.
media: Option<PollMedia>Media added to the poll option.
Implementations§
Source§impl PollOption
impl PollOption
Sourcepub fn new<A, B>(persistent_id: A, text: B, voter_count: Integer) -> Self
pub fn new<A, B>(persistent_id: A, text: B, voter_count: Integer) -> Self
Creates a new PollOption.
§Arguments
persistent_id- Unique identifier of the option.text- Option text; 1-100 characters.voter_count- Number of users that voted for this option.
Sourcepub fn with_added_by_chat<T>(self, value: T) -> Self
pub fn with_added_by_chat<T>(self, value: T) -> Self
Sourcepub fn with_added_by_user(self, value: User) -> Self
pub fn with_added_by_user(self, value: User) -> Self
Sourcepub fn with_addition_date(self, value: Integer) -> Self
pub fn with_addition_date(self, value: Integer) -> Self
Sourcepub fn with_media(self, value: PollMedia) -> Self
pub fn with_media(self, value: PollMedia) -> Self
Trait Implementations§
Source§impl Clone for PollOption
impl Clone for PollOption
Source§fn clone(&self) -> PollOption
fn clone(&self) -> PollOption
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PollOption
impl Debug for PollOption
Source§impl<'de> Deserialize<'de> for PollOption
impl<'de> Deserialize<'de> for PollOption
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 PollOption
impl PartialEq for PollOption
Source§fn eq(&self, other: &PollOption) -> bool
fn eq(&self, other: &PollOption) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PollOption
impl Serialize for PollOption
impl StructuralPartialEq for PollOption
Auto Trait Implementations§
impl Freeze for PollOption
impl RefUnwindSafe for PollOption
impl Send for PollOption
impl Sync for PollOption
impl Unpin for PollOption
impl UnsafeUnpin for PollOption
impl UnwindSafe for PollOption
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