#[non_exhaustive]
pub enum From {
User(User),
HiddenUser(String),
Channel {
chat: Box<Chat>,
message_id: Id,
signature: Option<String>,
},
AnonymousAdmin {
chat: Box<Chat>,
signature: Option<String>,
},
}
Expand description
Represents a forward source.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
User(User)
The forward is from a user.
HiddenUser(String)
The forward is from a user who decided to hide their profile.
Channel
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
The forward is from a channel.
AnonymousAdmin
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
The forward is from an anonymous group admin.
Implementations§
source§impl From
impl From
sourcepub fn expect_user(self) -> Userwhere
Self: Debug,
pub fn expect_user(self) -> Userwhere
Self: Debug,
Returns true
if self
is of variant HiddenUser
.
Unwraps the value, yielding the content of HiddenUser
.
Panics
Panics if the value is not HiddenUser
, with a panic message including the content of self
.
Returns Some
if self
is of variant HiddenUser
, and None
otherwise.
sourcepub fn is_channel(&self) -> bool
pub fn is_channel(&self) -> bool
Returns true
if self
is of variant Channel
.
sourcepub fn is_anonymous_admin(&self) -> bool
pub fn is_anonymous_admin(&self) -> bool
Returns true
if self
is of variant AnonymousAdmin
.