pub struct UserId(pub u64);Expand description
Identifier of a user.
Tuple Fields§
§0: u64Implementations§
source§impl UserId
impl UserId
sourcepub fn url(self) -> Url
pub fn url(self) -> Url
Returns an URL that links to the user with this id in the form of
tg://user/?id=<...>.
sourcepub fn is_anonymous(self) -> bool
pub fn is_anonymous(self) -> bool
Returns true if this is the id of the special user used by telegram
bot API to denote an anonymous user that sends messages on behalf of
a group.
sourcepub fn is_channel(self) -> bool
pub fn is_channel(self) -> bool
Returns true if this is the id of the special user used by telegram
bot API to denote an anonymous user that sends messages on behalf of
a channel.
sourcepub fn is_telegram(self) -> bool
pub fn is_telegram(self) -> bool
Returns true if this is the id of the special user used by telegram
itself.
It is sometimes also used as a fallback, for example when a channel post
is automatically forwarded to a group, bots in a group will get a
message where from is the Telegram user.
Trait Implementations§
source§impl<'de> Deserialize<'de> for UserId
impl<'de> Deserialize<'de> for UserId
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 Ord for UserId
impl Ord for UserId
source§impl PartialEq<UserId> for UserId
impl PartialEq<UserId> for UserId
source§impl PartialOrd<UserId> for UserId
impl PartialOrd<UserId> for UserId
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 more