Struct winrt_notification::Toast
[−]
[src]
pub struct Toast { /* fields omitted */ }
Methods
impl Toast
[src]
pub const POWERSHELL_APP_ID: &'static str
POWERSHELL_APP_ID: &'static str = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe"
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<(), Error>
[src]
Display the toast on the screen