pub enum PeerRef {
Username(String),
Id(i64),
Peer(Peer),
Input(InputPeer),
InviteHash(String),
Phone(String),
}Expand description
Flexible peer argument accepted by every Client method.
You rarely construct this directly. Pass any of the following and it is converted automatically:
"@username"or"username""me"or"self"- Numeric string
"123456789"(Bot-API encoded) i64ori32t.me/<username>URL- Invite link (
t.me/+HASH,t.me/joinchat/HASH,tg://join?invite=HASH) - E.164 phone number (
"+12025551234") tl::enums::Peerortl::enums::InputPeer
Variants§
Username(String)
Id(i64)
Peer(Peer)
Input(InputPeer)
InviteHash(String)
Phone(String)
E.164 phone number, e.g. "+12025551234".
Resolving a phone that isn’t already cached calls
contacts.importContacts, which adds it to the account’s contact
list as a side effect - unlike username/ID resolution, this is not
a read-only lookup.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerRef
impl RefUnwindSafe for PeerRef
impl Send for PeerRef
impl Sync for PeerRef
impl Unpin for PeerRef
impl UnsafeUnpin for PeerRef
impl UnwindSafe for PeerRef
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