pub struct Toast { /* private fields */ }
Expand description

Implementations

Creates an empty toast.

Add a Header to this toast.

The first text element, usually the title.

Example
// You can use anything that is Into<String>
toast.text1("text");

// Or you can use a `Text`
toast.text1(
    Text::new("text").with_placement(TextPlacement::Attribution)
);

The second text element, usually the body.

The third text element, usually the body or attribution.

Add an image with the corresponding ID to the toast.

ID

The image element in the toast template that this image is intended for. If a template has only one image, then this value is 1. The number of available image positions is based on the template definition.

Add a new action to the toast.

Set a remote id for the notification that enables the system to correlate this notification with another one generated on another device.

Set the scenario of this toast.

The scenario adjusts a few behaviors to create a consistent and unified user experience.

A string that is passed to the application when it is activated by the toast.

The format and contents of this string are defined by the app for its own use. When the user taps or clicks the toast to launch its associated app, the launch string provides the context to the app that allows it to show the user a view relevant to the toast content, rather than launching in its default way.

The amount of time the toast should display.

Set the expiration time of this toats, starting from the moment it is shown.

After expiration, the toast will be removed from the Notification Center.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.