Struct botapi::gen_types::PollAnswer
source · 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: String
Unique 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§fn eq(&self, other: &PollAnswer) -> bool
fn eq(&self, other: &PollAnswer) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for PollAnswer
impl PartialOrd for PollAnswer
source§fn partial_cmp(&self, other: &PollAnswer) -> Option<Ordering>
fn partial_cmp(&self, other: &PollAnswer) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.