pub enum MessageTo {
ChannelId(u64),
ChannelName(String),
UserIds(Vec<u64>),
UserEmails(Vec<String>),
}Expand description
Represents the recipient for the Zulip message.
Variants§
ChannelId(u64)
Represents the recipient channel ID.
ChannelName(String)
Represents the recipient channel name.
UserIds(Vec<u64>)
Represents the list of recipient user IDs.
UserEmails(Vec<String>)
Represents the list of recipient user Zulip API email adddresses.
Implementations§
Source§impl MessageTo
impl MessageTo
Sourcepub const CHANNEL_ID_FIELD: &str = "channel_id"
pub const CHANNEL_ID_FIELD: &str = "channel_id"
Represents the field name for channel ID.
Sourcepub const CHANNEL_NAME_FIELD: &str = "channel_name"
pub const CHANNEL_NAME_FIELD: &str = "channel_name"
Represents the field name for channel name.
Sourcepub const USER_IDS_FIELD: &str = "user_ids"
pub const USER_IDS_FIELD: &str = "user_ids"
Represents the field name for user IDs.
Sourcepub const USER_EMAILS_FIELD: &str = "user_emails"
pub const USER_EMAILS_FIELD: &str = "user_emails"
Represents the field name for user emails.
Sourcepub const fn field_name(&self) -> &'static str
pub const fn field_name(&self) -> &'static str
Gets the field name of the Self variant.
Sourcepub const fn channel_id(val: u64) -> Self
pub const fn channel_id(val: u64) -> Self
Creates a new channel ID Self.
Sourcepub fn as_channel_id(&self) -> Result<u64>
pub fn as_channel_id(&self) -> Result<u64>
Attempts to get the channel ID MessageTo variant.
Sourcepub fn channel_name<'c, C: Into<Cow<'c, str>>>(val: C) -> Self
pub fn channel_name<'c, C: Into<Cow<'c, str>>>(val: C) -> Self
Creates a new channel name Self.
Sourcepub fn as_channel_name(&self) -> Result<&str>
pub fn as_channel_name(&self) -> Result<&str>
Attempts to get the channel name MessageTo variant.
Sourcepub fn as_user_ids(&self) -> Result<&[u64]>
pub fn as_user_ids(&self) -> Result<&[u64]>
Attempts to get the user IDs MessageTo variant.
Sourcepub fn user_emails<'c, C: Into<Cow<'c, [String]>>>(val: C) -> Self
pub fn user_emails<'c, C: Into<Cow<'c, [String]>>>(val: C) -> Self
Creates a new user emails Self.
Sourcepub fn as_user_emails(&self) -> Result<&[String]>
pub fn as_user_emails(&self) -> Result<&[String]>
Attempts to get the user emails MessageTo variant.
pub fn as_string(&self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MessageTo
impl<'de> Deserialize<'de> for MessageTo
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 MessageTo
impl StructuralPartialEq for MessageTo
Auto Trait Implementations§
impl Freeze for MessageTo
impl RefUnwindSafe for MessageTo
impl Send for MessageTo
impl Sync for MessageTo
impl Unpin for MessageTo
impl UnsafeUnpin for MessageTo
impl UnwindSafe for MessageTo
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.