pub enum NotificationType {
NewCall(NotificationTypeNewCall),
NewMessage(NotificationTypeNewMessage),
NewPushMessage(NotificationTypeNewPushMessage),
NewSecretChat(NotificationTypeNewSecretChat),
// some variants omitted
}
Expand description
Contains detailed information about a notification
Variants§
NewCall(NotificationTypeNewCall)
New call was received
NewMessage(NotificationTypeNewMessage)
New message was received
NewPushMessage(NotificationTypeNewPushMessage)
New message was received through a push notification
NewSecretChat(NotificationTypeNewSecretChat)
New secret chat was created
Implementations§
Source§impl NotificationType
impl NotificationType
pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>
pub fn is_new_call(&self) -> bool
pub fn is_new_message(&self) -> bool
pub fn is_new_push_message(&self) -> bool
pub fn is_new_secret_chat(&self) -> bool
pub fn on_new_call<F: FnOnce(&NotificationTypeNewCall)>(&self, fnc: F) -> &Self
pub fn on_new_message<F: FnOnce(&NotificationTypeNewMessage)>( &self, fnc: F, ) -> &Self
pub fn on_new_push_message<F: FnOnce(&NotificationTypeNewPushMessage)>( &self, fnc: F, ) -> &Self
pub fn on_new_secret_chat<F: FnOnce(&NotificationTypeNewSecretChat)>( &self, fnc: F, ) -> &Self
pub fn as_new_call(&self) -> Option<&NotificationTypeNewCall>
pub fn as_new_message(&self) -> Option<&NotificationTypeNewMessage>
pub fn as_new_push_message(&self) -> Option<&NotificationTypeNewPushMessage>
pub fn as_new_secret_chat(&self) -> Option<&NotificationTypeNewSecretChat>
pub fn new_call<T: AsRef<NotificationTypeNewCall>>(t: T) -> Self
pub fn new_message<T: AsRef<NotificationTypeNewMessage>>(t: T) -> Self
pub fn new_push_message<T: AsRef<NotificationTypeNewPushMessage>>(t: T) -> Self
pub fn new_secret_chat<T: AsRef<NotificationTypeNewSecretChat>>(t: T) -> Self
Trait Implementations§
Source§impl AsRef<NotificationType> for NotificationType
impl AsRef<NotificationType> for NotificationType
Source§fn as_ref(&self) -> &NotificationType
fn as_ref(&self) -> &NotificationType
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for NotificationType
impl Clone for NotificationType
Source§fn clone(&self) -> NotificationType
fn clone(&self) -> NotificationType
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 NotificationType
impl Debug for NotificationType
Source§impl Default for NotificationType
impl Default for NotificationType
Source§impl<'de> Deserialize<'de> for NotificationType
impl<'de> Deserialize<'de> for NotificationType
Source§fn deserialize<D>(deserializer: D) -> Result<NotificationType, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<NotificationType, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl RObject for NotificationType
impl RObject for NotificationType
Auto Trait Implementations§
impl Freeze for NotificationType
impl RefUnwindSafe for NotificationType
impl Send for NotificationType
impl Sync for NotificationType
impl Unpin for NotificationType
impl UnwindSafe for NotificationType
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