pub struct PollAnswer {
pub poll_id: String,
pub voter_chat: Option<BoxWrapper<Unbox<Chat>>>,
pub user: Option<BoxWrapper<Unbox<User>>>,
pub option_ids: Vec<i64>,
}Expand description
This object represents an answer of a user in a non-anonymous poll.
Fields§
§poll_id: StringUnique poll identifier
voter_chat: Option<BoxWrapper<Unbox<Chat>>>Optional. The chat that changed the answer to the poll, if the voter is anonymous
user: Option<BoxWrapper<Unbox<User>>>Optional. The user that changed the answer to the poll, if the voter isn’t anonymous
option_ids: Vec<i64>0-based identifiers of chosen answer options. May be empty if the vote was retracted.
Implementations§
Source§impl PollAnswer
impl PollAnswer
pub fn noskip(self) -> NoSkipPollAnswer
Source§impl PollAnswer
impl PollAnswer
pub fn new(poll_id: String, option_ids: Vec<i64>) -> Self
Sourcepub fn get_poll_id<'a>(&'a self) -> &'a str
pub fn get_poll_id<'a>(&'a self) -> &'a str
Unique poll identifier
Sourcepub fn set_poll_id<'a>(&'a mut self, poll_id: String) -> &'a mut Self
pub fn set_poll_id<'a>(&'a mut self, poll_id: String) -> &'a mut Self
Unique poll identifier
Sourcepub fn get_voter_chat<'a>(&'a self) -> Option<&'a Chat>
pub fn get_voter_chat<'a>(&'a self) -> Option<&'a Chat>
Optional. The chat that changed the answer to the poll, if the voter is anonymous
Sourcepub fn set_voter_chat<'a>(
&'a mut self,
voter_chat: Option<Chat>,
) -> &'a mut Self
pub fn set_voter_chat<'a>( &'a mut self, voter_chat: Option<Chat>, ) -> &'a mut Self
Optional. The chat that changed the answer to the poll, if the voter is anonymous
Sourcepub fn get_user<'a>(&'a self) -> Option<&'a User>
pub fn get_user<'a>(&'a self) -> Option<&'a User>
Optional. The user that changed the answer to the poll, if the voter isn’t anonymous
Sourcepub fn set_user<'a>(&'a mut self, user: Option<User>) -> &'a mut Self
pub fn set_user<'a>(&'a mut self, user: Option<User>) -> &'a mut Self
Optional. The user that changed the answer to the poll, if the voter isn’t anonymous
Sourcepub fn get_option_ids<'a>(&'a self) -> &'a Vec<i64>
pub fn get_option_ids<'a>(&'a self) -> &'a Vec<i64>
0-based identifiers of chosen answer options. May be empty if the vote was retracted.
Sourcepub fn set_option_ids<'a>(&'a mut self, option_ids: Vec<i64>) -> &'a mut Self
pub fn set_option_ids<'a>(&'a mut self, option_ids: Vec<i64>) -> &'a mut Self
0-based identifiers of chosen answer options. May be empty if the vote was retracted.
Trait Implementations§
Source§impl Clone for PollAnswer
impl Clone for PollAnswer
Source§fn clone(&self) -> PollAnswer
fn clone(&self) -> PollAnswer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PollAnswer
impl Debug for PollAnswer
Source§impl Default for PollAnswer
impl Default for PollAnswer
Source§fn default() -> PollAnswer
fn default() -> PollAnswer
Source§impl<'de> Deserialize<'de> for PollAnswer
impl<'de> Deserialize<'de> for PollAnswer
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>,
Source§impl From<BoxWrapper<Box<PollAnswer>>> for PollAnswer
impl From<BoxWrapper<Box<PollAnswer>>> for PollAnswer
Source§fn from(t: BoxWrapper<Box<PollAnswer>>) -> Self
fn from(t: BoxWrapper<Box<PollAnswer>>) -> Self
Source§impl From<BoxWrapper<Unbox<PollAnswer>>> for PollAnswer
impl From<BoxWrapper<Unbox<PollAnswer>>> for PollAnswer
Source§fn from(t: BoxWrapper<Unbox<PollAnswer>>) -> Self
fn from(t: BoxWrapper<Unbox<PollAnswer>>) -> Self
Source§impl From<NoSkipPollAnswer> for PollAnswer
impl From<NoSkipPollAnswer> for PollAnswer
Source§fn from(t: NoSkipPollAnswer) -> Self
fn from(t: NoSkipPollAnswer) -> Self
Source§impl Hash for PollAnswer
impl Hash for PollAnswer
Source§impl Into<NoSkipPollAnswer> for PollAnswer
impl Into<NoSkipPollAnswer> for PollAnswer
Source§fn into(self) -> NoSkipPollAnswer
fn into(self) -> NoSkipPollAnswer
Source§impl Ord for PollAnswer
impl Ord for PollAnswer
Source§fn cmp(&self, other: &PollAnswer) -> Ordering
fn cmp(&self, other: &PollAnswer) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PollAnswer
impl PartialEq for PollAnswer
Source§impl PartialOrd for PollAnswer
impl PartialOrd for PollAnswer
Source§impl Serialize for PollAnswer
impl Serialize for PollAnswer
impl Eq for PollAnswer
impl StructuralPartialEq for PollAnswer
Auto Trait Implementations§
impl Freeze for PollAnswer
impl RefUnwindSafe for PollAnswer
impl Send for PollAnswer
impl Sync for PollAnswer
impl Unpin for PollAnswer
impl UnwindSafe for PollAnswer
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.