pub struct BarkMessage { /* private fields */ }Implementations§
Source§impl BarkMessage
impl BarkMessage
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/send_message.rs (line 14)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 14)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}Sourcepub fn title(self, v: impl Into<String>) -> Self
pub fn title(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 15)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 15)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}Sourcepub fn subtitle(self, v: impl Into<String>) -> Self
pub fn subtitle(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 16)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 16)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}Sourcepub fn body(self, v: impl Into<String>) -> Self
pub fn body(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 17)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 17)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}pub fn device_key(self, v: impl Into<String>) -> Self
pub fn device_keys(self, v: Vec<String>) -> Self
Sourcepub fn level(self, v: Level) -> Self
pub fn level(self, v: Level) -> Self
Examples found in repository?
examples/send_message.rs (line 23)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 23)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}Sourcepub fn volume(self, v: u8) -> Self
pub fn volume(self, v: u8) -> Self
Examples found in repository?
examples/send_message.rs (line 22)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 22)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}pub fn badge(self, v: u32) -> Self
Sourcepub fn call(self, v: impl Into<String>) -> Self
pub fn call(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 21)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 21)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}pub fn auto_copy(self, v: impl Into<String>) -> Self
Sourcepub fn copy(self, v: impl Into<String>) -> Self
pub fn copy(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 20)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 20)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}Sourcepub fn sound(self, v: impl Into<String>) -> Self
pub fn sound(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 18)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 18)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}pub fn icon(self, v: impl Into<String>) -> Self
Sourcepub fn group(self, v: impl Into<String>) -> Self
pub fn group(self, v: impl Into<String>) -> Self
Examples found in repository?
examples/send_message.rs (line 19)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 false,
10 None,
11 None,
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26
27 println!("code:{},msg:{}", res.code, res.message);
28 Ok(())
29}More examples
examples/send_message_encrypt.rs (line 19)
5async fn main() -> Result<()> {
6 let client = BarkClient::new(
7 "https://api.day.app",
8 "YOUR_DEVICE_KEY",
9 true,
10 Some("YOUR_KEY".to_owned()),
11 Some("YOUR_IV".to_owned()),
12 );
13
14 let msg = BarkMessage::new()
15 .title("测试")
16 .subtitle("推送设置副标题")
17 .body("推送设置正文")
18 .sound("alarm")
19 .group("测试组1")
20 .copy("www.google.com")
21 .call("1")
22 .volume(1)
23 .level(Level::Critical);
24
25 let res = client.send(&msg).await?;
26 println!("code:{},msg:{}", res.code, res.message);
27 Ok(())
28}pub fn ciphertext(self, v: impl Into<String>) -> Self
pub fn is_archive(self, v: impl Into<String>) -> Self
pub fn url(self, v: impl Into<String>) -> Self
pub fn action(self, v: impl Into<String>) -> Self
pub fn id(self, v: impl Into<String>) -> Self
pub fn delete(self, v: impl Into<String>) -> Self
Trait Implementations§
Source§impl Debug for BarkMessage
impl Debug for BarkMessage
Source§impl Default for BarkMessage
impl Default for BarkMessage
Auto Trait Implementations§
impl Freeze for BarkMessage
impl RefUnwindSafe for BarkMessage
impl Send for BarkMessage
impl Sync for BarkMessage
impl Unpin for BarkMessage
impl UnsafeUnpin for BarkMessage
impl UnwindSafe for BarkMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more