pub struct CachedPeer {
pub id: i64,
pub access_hash: i64,
pub is_channel: bool,
pub is_chat: bool,
pub channel_kind: Option<ChannelKind>,
pub is_community: bool,
}Expand description
A cached access-hash entry so that the peer can be addressed across restarts without re-resolving it from Telegram.
Fields§
§id: i64Bare Telegram peer ID (always positive).
access_hash: i64Access hash bound to the current session. Always 0 for regular group chats (they need no access_hash).
is_channel: booltrue → channel / supergroup. false → user or regular group.
is_chat: booltrue → regular group chat (Chat::Chat / ChatForbidden).
When true, access_hash is meaningless (groups need no hash).
channel_kind: Option<ChannelKind>For channel peers: the kind (broadcast / megagroup / gigagroup).
None for users, regular groups, and channels loaded from a pre-v6 session.
is_community: booltrue → Telegram Community entity, addressed the same way as a
channel on the wire but tracked separately so it is never mistaken
for one. false for every other peer kind, and for any peer loaded
from a pre-v8 session.
Trait Implementations§
Source§impl Clone for CachedPeer
impl Clone for CachedPeer
Source§fn clone(&self) -> CachedPeer
fn clone(&self) -> CachedPeer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more