[][src]Struct winrt_notification::Toast

pub struct Toast { /* fields omitted */ }

Implementations

impl Toast[src]

pub const POWERSHELL_APP_ID: &'static str[src]

This can be used if you do not have a AppUserModelID.

However, the toast will erroniously report its origin as powershell.

pub fn new(app_id: &str) -> Toast[src]

Constructor for the toast builder.

app_id is the running application's AppUserModelID.

If the program you are using this in was not installed, use Toast::POWERSHELL_APP_ID for now

pub fn title(self, content: &str) -> Toast[src]

Sets the title of the toast.

Will be white. Supports Unicode ✓

pub fn text1(self, content: &str) -> Toast[src]

Add/Sets the first line of text below title.

Will be grey. Supports Unicode ✓

pub fn text2(self, content: &str) -> Toast[src]

Add/Sets the second line of text below title.

Will be grey. Supports Unicode ✓

pub fn duration(self, duration: Duration) -> Toast[src]

Set the length of time to show the toast

pub fn icon(self, source: &Path, crop: IconCrop, alt_text: &str) -> Toast[src]

Set the icon shown in the upper left of the toast

The default is determined by your app id. If you are using the powershell workaround, it will be the powershell icon

pub fn hero(self, source: &Path, alt_text: &str) -> Toast[src]

Add/Set a Hero image for the toast.

This will be above the toast text and the icon.

pub fn image(self, source: &Path, alt_text: &str) -> Toast[src]

Add an image to the toast

May be done many times. Will appear below text.

pub fn sound(self, src: Option<Sound>) -> Toast[src]

Set the sound for the toast or silence it

Default is Sound::IM

pub fn show(&self) -> Result<()>[src]

Display the toast on the screen

Auto Trait Implementations

impl RefUnwindSafe for Toast[src]

impl Send for Toast[src]

impl Sync for Toast[src]

impl Unpin for Toast[src]

impl UnwindSafe for Toast[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.