Skip to main content

ActiveNotification

Struct ActiveNotification 

Source
pub struct ActiveNotification { /* private fields */ }
Expand description

A notification that was delivered and is still visible in the notification center.

Returned by Notification::active, which is only available on mobile. Which fields are populated depends on the platform, since Android and iOS expose different information about delivered notifications.

Implementations§

Source§

impl ActiveNotification

Source

pub fn id(&self) -> i32

The notification identifier.

Source

pub fn tag(&self) -> Option<&str>

The tag the notification was posted with.

Only set on Android.

Source

pub fn title(&self) -> Option<&str>

The notification title, if it was set.

Source

pub fn body(&self) -> Option<&str>

The notification body, if it was set.

Source

pub fn group(&self) -> Option<&str>

The identifier of the group the notification belongs to.

Only set on Android.

Source

pub fn group_summary(&self) -> bool

Whether the notification is the summary of its group.

Only set on Android. Defaults to false.

Source

pub fn data(&self) -> &HashMap<String, String>

The platform extras attached to the notification, as string values.

Only set on Android, where it holds the android.app.Notification extras bundle.

Source

pub fn extra(&self) -> &HashMap<String, Value>

The extra payload that was stored in the notification.

Source

pub fn attachments(&self) -> &[Attachment]

The attachments of the notification.

Only set on iOS.

Source

pub fn action_type_id(&self) -> Option<&str>

The identifier of the action type the notification was registered with.

Only set on iOS.

Source

pub fn schedule(&self) -> Option<&Schedule>

The schedule the notification was delivered with, if it was scheduled.

Source

pub fn sound(&self) -> Option<&str>

The sound resource name of the notification.

Only set on iOS.

Trait Implementations§

Source§

impl Debug for ActiveNotification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ActiveNotification

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

Source§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the CommandItem. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

Source§

type Error = Error

The error type.
Source§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more