File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change
1
+ # rs-os
2
+
3
+ - OS 操作系统 API 相关的库 & 使用示例.
4
+
5
+ ## rs-cross:
6
+
7
+ - 跨平台相关的库
8
+
9
+ ### libs:
10
+
11
+ - [ try-notify] ( ./rs-cross/try-notify ) : 系统通知(macOS/Windows/Linux)
12
+ - 基于: https://github.com/hoodie/notify-rust
Original file line number Diff line number Diff line change
1
+ #[ cfg( target_os = "macos" ) ]
2
+ fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
3
+ use notify_rust:: Notification ;
4
+
5
+ Notification :: new ( )
6
+ . summary ( "Safari Crashed" )
7
+ . body ( "Just kidding, this is just the notify_rust example." )
8
+ . appname ( "Toastify" )
9
+ . icon ( "Toastify" )
10
+ . show ( ) ?;
11
+
12
+ Ok ( ( ) )
13
+ }
14
+
15
+ #[ cfg( all( unix, not( target_os = "macos" ) ) ) ]
16
+ fn main ( ) {
17
+ println ! ( "this is a mac only feature" )
18
+ }
19
+
20
+ #[ cfg( target_os = "windows" ) ]
1
21
fn main ( ) {
2
- println ! ( "Hello, world!" ) ;
22
+ println ! ( "this is a mac only feature" )
3
23
}
You can’t perform that action at this time.
0 commit comments