pub struct DmChannel {
pub channel_id: ChannelId,
pub participants: [MemberId; 2],
pub rest: Map<String, Value>,
}Expand description
A DM channel: an ordinary channel object of kind dm with its two participants.
Fields§
§channel_id: ChannelIdThe channel.
participants: [MemberId; 2]Its two members, sorted.
rest: Map<String, Value>The rest of the channel object, as the host sent it.
Implementations§
Source§impl DmChannel
impl DmChannel
Sourcepub fn between(channel_id: ChannelId, a: MemberId, b: MemberId) -> Self
pub fn between(channel_id: ChannelId, a: MemberId, b: MemberId) -> Self
A DM learnt only from a message in it: the two members, no other field.
Sourcepub fn from_channel(channel: &Channel) -> Option<Self>
pub fn from_channel(channel: &Channel) -> Option<Self>
The DM a channel object describes; None for any other kind of channel, or a DM
without exactly two participants.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DmChannel
impl<'de> Deserialize<'de> for DmChannel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DmChannel
impl StructuralPartialEq for DmChannel
Auto Trait Implementations§
impl Freeze for DmChannel
impl RefUnwindSafe for DmChannel
impl Send for DmChannel
impl Sync for DmChannel
impl Unpin for DmChannel
impl UnsafeUnpin for DmChannel
impl UnwindSafe for DmChannel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CryptoSafe for T
impl<T> CryptoSafe for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more