Debian Codegraph @

examples/reuse.rs

raw symbols SCIP
1 use notify_rustrust-analyzer cargo notify-rust 4.18.0 crate/::Notificationrust-analyzer cargo notify-rust 4.18.0 notification/Notification#;
2 fn mainrust-analyzer cargo notify-rust 4.18.0 main().() {
3 // here we create a notification and then reuse a second time
4
5 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().()
6 .summaryrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]summary().("News update")
7 .iconrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]icon().("computer")
8 .bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().("Something bad happened")
9 .finalizerust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]finalize().();
10
11 notification.showrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]show().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
12
13 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().(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#::from_millisrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_millis().(1500));
14
15 notification.bodyrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]body().("just kidding, nothing happened");
16 notification.showrust-analyzer cargo notify-rust 4.18.0 notification/impl#[Notification]show().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
17 }