| 1 | #[cfg(any(target_os = "windows", target_os = "macos"))] |
| 2 | fn main() { |
| 3 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("this is an xdg only feature") |
| 4 | } |
| 5 | |
| 6 | #[cfg(all(unix, not(target_os = "macos")))] |
| 7 | fn mainrust-analyzer cargo notify-rust 4.18.0 main().() { |
| 8 | use notify_rustrust-analyzer cargo notify-rust 4.18.0 crate/::{CloseReasonrust-analyzer cargo notify-rust 4.18.0 response/CloseReason#, Notificationrust-analyzer cargo notify-rust 4.18.0 notification/Notification#}; |
| 9 | |
| 10 | zbusrust-analyzer cargo zbus 5.19.0 crate/::block_onrust-analyzer cargo zbus 5.19.0 utils/block_on().(async { |
| 11 | Notificationrust-analyzer cargo notify-rust 4.18.0 notification/Notification#::newrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]new().() |
| 12 | .summaryrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]summary().("Don't Mind me") |
| 13 | .hintrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]hint().(notify_rustrust-analyzer cargo notify-rust 4.18.0 crate/::Hintrust-analyzer cargo notify-rust 4.18.0 hints/Hint#::Transientrust-analyzer cargo notify-rust 4.18.0 hints/Hint#Transient#(true)) |
| 14 | .bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().("I'll be gone soon enough.\nSorry for the inconvenience.") |
| 15 | .show_asyncrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]show_async().() |
| 16 | .rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll(). |
| 17 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 18 | .on_closerust-analyzer cargo notify-rust 4.18.0 xdg/impl#[NotificationHandle]on_close().(|reason: CloseReasonrust-analyzer cargo notify-rust 4.18.0 response/CloseReason#| { |
| 19 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("the notification was closed reason: {reason:?}") |
| 20 | }); |
| 21 | |
| 22 | Notificationrust-analyzer cargo notify-rust 4.18.0 notification/Notification#::newrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]new().() |
| 23 | .summaryrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]summary().("Pick an option") |
| 24 | .bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().("Click one of the action buttons below.") |
| 25 | .actionrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]action().("option-a", "Option A") |
| 26 | .actionrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]action().("option-b", "Option B") |
| 27 | .show_asyncrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]show_async().() |
| 28 | .rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll(). |
| 29 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 30 | .wait_for_action_asyncrust-analyzer cargo notify-rust 4.18.0 xdg/impl#[NotificationHandle]wait_for_action_async().(|action| { |
| 31 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("action invoked: {action:?}"); |
| 32 | }) |
| 33 | .rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().; |
| 34 | }) |
| 35 | } |