| 1 | #![allow(unused_imports, dead_code)] |
| 2 | use notify_rustrust-analyzer cargo notify-rust 4.18.0 crate/::Notificationrust-analyzer cargo notify-rust 4.18.0 notification/Notification#; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::timerust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/::Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#; |
| 4 | |
| 5 | #[cfg(any(target_os = "windows", target_os = "macos"))] |
| 6 | fn main() { |
| 7 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("this is a xdg only feature") |
| 8 | } |
| 9 | |
| 10 | #[cfg(all(unix, not(target_os = "macos")))] |
| 11 | fn mainrust-analyzer cargo notify-rust 4.18.0 main().() { |
| 12 | let mut notification = Notificationrust-analyzer cargo notify-rust 4.18.0 notification/Notification#::newrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]new().() |
| 13 | .summaryrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]summary().("Rocket launch in ...") |
| 14 | .bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().("count down") |
| 15 | .iconrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]icon().("clock") |
| 16 | .timeoutrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]timeout().(0) |
| 17 | .showrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]show().() |
| 18 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 19 | |
| 20 | for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#11 { |
| 21 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::threadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std thread/::sleeprust-analyzer cargo std https://github.com/rust-lang/rust/library/std thread/functions/sleep().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_millisrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_millis().(1_000)); |
| 22 | notification |
| 23 | .bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().(&formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("T-minus {}", 10 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). i)) |
| 24 | .appnamerust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]appname().(&formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("countdown_{}", 10 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). i)); |
| 25 | notification.updaterust-analyzer cargo notify-rust 4.18.0 xdg/impl#[NotificationHandle]update().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 26 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", 10 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). i); |
| 27 | } |
| 28 | notification |
| 29 | .bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().("TAKE OFF") |
| 30 | .appnamerust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]appname().("countdown_takeoff") |
| 31 | .showrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]show().() |
| 32 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 33 | } |