pub struct UserId(pub u64);
Expand description
Identifier of a user.
Tuple Fields§
§0: u64
Implementations§
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<UserId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<UserId, <__D as Deserializer<'de>>::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 moresource§impl Serialize for UserId
impl Serialize for UserId
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 Copy for UserId
impl Eq for UserId
impl StructuralEq for UserId
impl StructuralPartialEq for UserId
Auto Trait Implementations§
impl RefUnwindSafe for UserId
impl Send for UserId
impl Sync for UserId
impl Unpin for UserId
impl UnwindSafe for UserId
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.