pub struct Dialog {
pub raw: Dialog,
pub message: Option<Message>,
pub entity: Option<User>,
pub chat: Option<Chat>,
}Expand description
A Telegram dialog (chat, user, channel).
Fields§
§raw: Dialog§message: Option<Message>§entity: Option<User>§chat: Option<Chat>Implementations§
Source§impl Dialog
impl Dialog
Sourcepub fn peer(&self) -> Option<&Peer>
pub fn peer(&self) -> Option<&Peer>
Peer of this dialog.
None for folders and for community dialogs - communities are
addressed by community_id (see dialogCommunity), not by a
Peer, since layer 228 didn’t add a corresponding Peer::Community
variant.
Sourcepub fn unread_count(&self) -> i32
pub fn unread_count(&self) -> i32
Unread message count.
Sourcepub fn top_message(&self) -> i32
pub fn top_message(&self) -> i32
ID of the top message.
Sourcepub fn matches_filter(&self, filter: &FlattenedDialogFilter) -> bool
pub fn matches_filter(&self, filter: &FlattenedDialogFilter) -> bool
Whether this dialog belongs to the given chat folder.
exclude_peers always loses, pinned_peers/include_peers always
win, and everything else falls back to the contacts/non_contacts/
groups/broadcasts/bots flags plus exclude_muted/read/archived. The
“All Chats” default filter always matches; folders (no Peer) never do.
Takes a pre-flattened filter rather than the raw tl::enums::DialogFilter
- build one once per filter with
FlattenedDialogFilter::fromand reuse it across every dialog in the scroll, rather than re-scanning the filter’s peer lists on every single call.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dialog
impl RefUnwindSafe for Dialog
impl Send for Dialog
impl Sync for Dialog
impl Unpin for Dialog
impl UnsafeUnpin for Dialog
impl UnwindSafe for Dialog
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