pub enum TopLevelId {
AtName(String),
Id(u64),
}Expand description
Top-level identifier for a Telegram channel or group.
This type is specifically for channels/supergroups which use the -100 prefix
in their full chat IDs.
Variants§
AtName(String)
Username like “@channel_name” or “channel_name”
Id(u64)
Numeric ID (without -100 prefix)
Implementations§
Source§impl TopLevelId
impl TopLevelId
Sourcepub fn chat_id_param(&self) -> String
pub fn chat_id_param(&self) -> String
Get the chat_id parameter value for Telegram API
Sourcepub fn numeric_id(&self) -> Option<u64>
pub fn numeric_id(&self) -> Option<u64>
Get the numeric ID if available
Trait Implementations§
Source§impl Clone for TopLevelId
impl Clone for TopLevelId
Source§fn clone(&self) -> TopLevelId
fn clone(&self) -> TopLevelId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TopLevelId
impl Debug for TopLevelId
Source§impl<'de> Deserialize<'de> for TopLevelId
impl<'de> Deserialize<'de> for TopLevelId
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 Hash for TopLevelId
impl Hash for TopLevelId
Source§impl PartialEq for TopLevelId
impl PartialEq for TopLevelId
Source§impl Serialize for TopLevelId
impl Serialize for TopLevelId
impl Eq for TopLevelId
impl StructuralPartialEq for TopLevelId
Auto Trait Implementations§
impl Freeze for TopLevelId
impl RefUnwindSafe for TopLevelId
impl Send for TopLevelId
impl Sync for TopLevelId
impl Unpin for TopLevelId
impl UnwindSafe for TopLevelId
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