#[non_exhaustive]pub enum ChatMemberRole {
Admin,
Member,
Other(String),
}Expand description
Role of a participant in a group Chat.
The spec defines two well-known values: "admin" and "member".
Other(String) preserves any unrecognized value for lossless round-trip.
Wire strings: "admin", "member".
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Admin
Group or channel administrator with management permissions.
Member
Regular member.
Other(String)
Catch-all for any unrecognized wire value from a future spec version.
Forging caveat: see QuotaScope::Other for the full
discussion. Constructing ChatMemberRole::Other("admin".into())
produces a value that is unequal to ChatMemberRole::Admin on
PartialEq but serialises to the same wire string "admin"
and round-trips back to ChatMemberRole::Admin. Reserve
Other(s) for genuinely unrecognised wire strings; compare
wire equality via as_str(), not PartialEq.
Implementations§
Trait Implementations§
Source§impl Clone for ChatMemberRole
impl Clone for ChatMemberRole
Source§fn clone(&self) -> ChatMemberRole
fn clone(&self) -> ChatMemberRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChatMemberRole
impl Debug for ChatMemberRole
Source§impl<'de> Deserialize<'de> for ChatMemberRole
impl<'de> Deserialize<'de> for ChatMemberRole
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for ChatMemberRole
impl Display for ChatMemberRole
Source§impl PartialEq for ChatMemberRole
impl PartialEq for ChatMemberRole
Source§fn eq(&self, other: &ChatMemberRole) -> bool
fn eq(&self, other: &ChatMemberRole) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ChatMemberRole
impl Serialize for ChatMemberRole
impl StructuralPartialEq for ChatMemberRole
Auto Trait Implementations§
impl Freeze for ChatMemberRole
impl RefUnwindSafe for ChatMemberRole
impl Send for ChatMemberRole
impl Sync for ChatMemberRole
impl Unpin for ChatMemberRole
impl UnsafeUnpin for ChatMemberRole
impl UnwindSafe for ChatMemberRole
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
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.