pub enum ChatId {
Direct(ContactId),
Group {
id: GroupId,
scope: Option<MemberId>,
},
Local(UserId),
}Expand description
Identifies a chat: direct contact, group (optionally scoped to a member support thread), or local note-to-self.
Variants§
Implementations§
Source§impl ChatId
impl ChatId
Sourcepub fn with_group_scope(id: GroupId, group_member_support_id: MemberId) -> Self
pub fn with_group_scope(id: GroupId, group_member_support_id: MemberId) -> Self
Creates a ChatId::Group scoped to a member support thread.
Sourcepub fn from_chat_ref(chat_ref: &ChatRef) -> Option<Self>
pub fn from_chat_ref(chat_ref: &ChatRef) -> Option<Self>
Converts a ChatRef from a SimpleX API response. Returns None for unrecognised chat types.
Sourcepub fn from_chat_info(chat_info: &ChatInfo) -> Option<Self>
pub fn from_chat_info(chat_info: &ChatInfo) -> Option<Self>
Converts a ChatInfo from a SimpleX API response. Returns None for unrecognised chat types.
Sourcepub fn into_chat_ref(self) -> ChatRef
pub fn into_chat_ref(self) -> ChatRef
Converts back into a ChatRef for use in raw API calls.
pub fn is_direct(&self) -> bool
pub fn is_group(&self) -> bool
pub fn is_local(&self) -> bool
Trait Implementations§
Source§impl Ord for ChatId
impl Ord for ChatId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for ChatId
impl PartialOrd for ChatId
impl Copy for ChatId
impl Eq for ChatId
impl StructuralPartialEq for ChatId
Auto Trait Implementations§
impl Freeze for ChatId
impl RefUnwindSafe for ChatId
impl Send for ChatId
impl Sync for ChatId
impl Unpin for ChatId
impl UnsafeUnpin for ChatId
impl UnwindSafe for ChatId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more