pub enum DisplayRecipient {
Channel(String),
User(Vec<UserRecipient>),
}Expand description
Represents the metadata for recipients who were displayed a message.
Variants§
Channel(String)
Represents the channel for a message.
User(Vec<UserRecipient>)
Represents the list of user recipients of a message.
Implementations§
Source§impl DisplayRecipient
impl DisplayRecipient
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new DisplayRecipient.
Sourcepub const fn variant_name(&self) -> &'static str
pub const fn variant_name(&self) -> &'static str
Gets the variant name.
Sourcepub fn channel<'c, C: Into<Cow<'c, str>>>(val: C) -> Self
pub fn channel<'c, C: Into<Cow<'c, str>>>(val: C) -> Self
Converta a String-like argument into a Self.
Sourcepub fn as_channel(&self) -> Result<&str>
pub fn as_channel(&self) -> Result<&str>
Attempts to get the inner channel recipient.
Sourcepub fn user<'c, C: Into<Cow<'c, [UserRecipient]>>>(val: C) -> Self
pub fn user<'c, C: Into<Cow<'c, [UserRecipient]>>>(val: C) -> Self
Converta a Vec<UserRecipient>-like argument into a Self.
Sourcepub fn as_user(&self) -> Result<&[UserRecipient]>
pub fn as_user(&self) -> Result<&[UserRecipient]>
Attempts to get the inner user recipient.
Trait Implementations§
Source§impl Clone for DisplayRecipient
impl Clone for DisplayRecipient
Source§impl Debug for DisplayRecipient
impl Debug for DisplayRecipient
Source§impl Default for DisplayRecipient
impl Default for DisplayRecipient
Source§impl<'de> Deserialize<'de> for DisplayRecipient
impl<'de> Deserialize<'de> for DisplayRecipient
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
Source§impl Display for DisplayRecipient
impl Display for DisplayRecipient
impl Eq for DisplayRecipient
Source§impl<'c> From<&'c DisplayRecipient> for Cow<'c, DisplayRecipient>
impl<'c> From<&'c DisplayRecipient> for Cow<'c, DisplayRecipient>
Source§fn from(val: &'c DisplayRecipient) -> Self
fn from(val: &'c DisplayRecipient) -> Self
Converts to this type from the input type.
Source§impl<'c> From<Cow<'c, DisplayRecipient>> for DisplayRecipient
impl<'c> From<Cow<'c, DisplayRecipient>> for DisplayRecipient
Source§impl<'c> From<DisplayRecipient> for Cow<'c, DisplayRecipient>
impl<'c> From<DisplayRecipient> for Cow<'c, DisplayRecipient>
Source§fn from(val: DisplayRecipient) -> Self
fn from(val: DisplayRecipient) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DisplayRecipient
impl PartialEq for DisplayRecipient
Source§impl Serialize for DisplayRecipient
impl Serialize for DisplayRecipient
impl StructuralPartialEq for DisplayRecipient
Auto Trait Implementations§
impl Freeze for DisplayRecipient
impl RefUnwindSafe for DisplayRecipient
impl Send for DisplayRecipient
impl Sync for DisplayRecipient
impl Unpin for DisplayRecipient
impl UnsafeUnpin for DisplayRecipient
impl UnwindSafe for DisplayRecipient
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.