Skip to main content

SyncBarkMessageBuilder

Struct SyncBarkMessageBuilder 

Source
pub struct SyncBarkMessageBuilder<'a> { /* private fields */ }
Expand description

同步 Bark 消息构建器

SyncBarkClient 关联的消息构建器,提供流畅的 API 来构建和直接发送消息。 它包装了通用的 BarkMessageBuilder 并添加了 send() 方法。

§特性

§示例

use bark_rs::{SyncBarkClient, Level};

let client = SyncBarkClient::with_device_key("https://api.day.app", "key");

// 构建并发送
let response = client
    .message()
    .title("标题")
    .body("内容")
    .level(Level::Active)
    .send()?;

// 或者只构建
let message = client
    .message()
    .body("内容")
    .build();

Implementations§

Source§

impl<'a> SyncBarkMessageBuilder<'a>

Source

pub fn body(self, body: &str) -> Self

设置推送内容(必需)

详细说明请参见 BarkMessageBuilder::body

Examples found in repository?
examples/batch_push.rs (line 16)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
More examples
Hide additional examples
examples/sync_client.rs (line 11)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端(带默认设备密钥)
5    let client = SyncBarkClient::with_device_key("https://api.day.app", "QJ48vPutCAsPW2B6pE2A3a");
6
7    // 方式1: 使用客户端的链式调用
8    let response = client
9        .message()
10        .title("同步推送")
11        .body("这是同步客户端发送的消息")
12        .level(Level::Active)
13        .volume(7)
14        .send()?;
15
16    println!(
17        "同步推送成功: code={}, message={}",
18        response.code, response.message
19    );
20
21    // 方式2: 先构建消息,再发送
22    let message = BarkMessage::builder()
23        .title("独立构建的消息")
24        .body("消息构建与发送分离")
25        .level(Level::Critical)
26        .sound("alarm")
27        .badge(1)
28        .build();
29
30    let response = client.send(&message)?;
31    println!(
32        "独立消息发送成功: code={}, message={}",
33        response.code, response.message
34    );
35
36    Ok(())
37}
examples/error_handling.rs (line 28)
3fn main() {
4    println!("🚨 演示错误处理");
5
6    // 创建没有默认设备密钥的客户端
7    let client = SyncBarkClient::new("https://api.day.app");
8
9    // 尝试发送没有设备密钥的消息
10    let message_without_key = BarkMessage::builder()
11        .title("错误演示")
12        .body("这个消息没有设备密钥")
13        .build();
14
15    match client.send(&message_without_key) {
16        Ok(_) => println!("❌ 意外成功"),
17        Err(BarkError::MissingDeviceKey) => {
18            println!("✅ 正确捕获到缺少设备密钥错误");
19        }
20        Err(e) => println!("❓ 其他错误: {}", e),
21    }
22
23    // 演示正确的错误处理模式
24    let result = client
25        .message()
26        .device_key("QJ48vPutCAsPW2B6pE2A3a")
27        .title("正确的消息")
28        .body("这个消息有设备密钥")
29        .send();
30
31    match result {
32        Ok(response) => {
33            println!(
34                "✅ 消息发送成功: code={}, message={}",
35                response.code, response.message
36            );
37        }
38        Err(BarkError::RequestError(e)) => {
39            println!("❌ 网络请求错误: {}", e);
40        }
41        Err(BarkError::MissingDeviceKey) => {
42            println!("❌ 缺少设备密钥");
43        }
44        Err(BarkError::SerializationError(e)) => {
45            println!("❌ 序列化错误: {}", e);
46        }
47        Err(BarkError::InvalidUrl) => {
48            println!("❌ 无效URL");
49        }
50    }
51
52    println!("🎉 错误处理演示完成!");
53}
Source

pub fn title(self, title: &str) -> Self

设置推送标题

详细说明请参见 BarkMessageBuilder::title

Examples found in repository?
examples/batch_push.rs (line 15)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
More examples
Hide additional examples
examples/sync_client.rs (line 10)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端(带默认设备密钥)
5    let client = SyncBarkClient::with_device_key("https://api.day.app", "QJ48vPutCAsPW2B6pE2A3a");
6
7    // 方式1: 使用客户端的链式调用
8    let response = client
9        .message()
10        .title("同步推送")
11        .body("这是同步客户端发送的消息")
12        .level(Level::Active)
13        .volume(7)
14        .send()?;
15
16    println!(
17        "同步推送成功: code={}, message={}",
18        response.code, response.message
19    );
20
21    // 方式2: 先构建消息,再发送
22    let message = BarkMessage::builder()
23        .title("独立构建的消息")
24        .body("消息构建与发送分离")
25        .level(Level::Critical)
26        .sound("alarm")
27        .badge(1)
28        .build();
29
30    let response = client.send(&message)?;
31    println!(
32        "独立消息发送成功: code={}, message={}",
33        response.code, response.message
34    );
35
36    Ok(())
37}
examples/error_handling.rs (line 27)
3fn main() {
4    println!("🚨 演示错误处理");
5
6    // 创建没有默认设备密钥的客户端
7    let client = SyncBarkClient::new("https://api.day.app");
8
9    // 尝试发送没有设备密钥的消息
10    let message_without_key = BarkMessage::builder()
11        .title("错误演示")
12        .body("这个消息没有设备密钥")
13        .build();
14
15    match client.send(&message_without_key) {
16        Ok(_) => println!("❌ 意外成功"),
17        Err(BarkError::MissingDeviceKey) => {
18            println!("✅ 正确捕获到缺少设备密钥错误");
19        }
20        Err(e) => println!("❓ 其他错误: {}", e),
21    }
22
23    // 演示正确的错误处理模式
24    let result = client
25        .message()
26        .device_key("QJ48vPutCAsPW2B6pE2A3a")
27        .title("正确的消息")
28        .body("这个消息有设备密钥")
29        .send();
30
31    match result {
32        Ok(response) => {
33            println!(
34                "✅ 消息发送成功: code={}, message={}",
35                response.code, response.message
36            );
37        }
38        Err(BarkError::RequestError(e)) => {
39            println!("❌ 网络请求错误: {}", e);
40        }
41        Err(BarkError::MissingDeviceKey) => {
42            println!("❌ 缺少设备密钥");
43        }
44        Err(BarkError::SerializationError(e)) => {
45            println!("❌ 序列化错误: {}", e);
46        }
47        Err(BarkError::InvalidUrl) => {
48            println!("❌ 无效URL");
49        }
50    }
51
52    println!("🎉 错误处理演示完成!");
53}
Source

pub fn subtitle(self, subtitle: &str) -> Self

设置推送副标题

详细说明请参见 BarkMessageBuilder::subtitle

Source

pub fn device_key(self, device_key: &str) -> Self

设置单个设备密钥

详细说明请参见 BarkMessageBuilder::device_key

Examples found in repository?
examples/error_handling.rs (line 26)
3fn main() {
4    println!("🚨 演示错误处理");
5
6    // 创建没有默认设备密钥的客户端
7    let client = SyncBarkClient::new("https://api.day.app");
8
9    // 尝试发送没有设备密钥的消息
10    let message_without_key = BarkMessage::builder()
11        .title("错误演示")
12        .body("这个消息没有设备密钥")
13        .build();
14
15    match client.send(&message_without_key) {
16        Ok(_) => println!("❌ 意外成功"),
17        Err(BarkError::MissingDeviceKey) => {
18            println!("✅ 正确捕获到缺少设备密钥错误");
19        }
20        Err(e) => println!("❓ 其他错误: {}", e),
21    }
22
23    // 演示正确的错误处理模式
24    let result = client
25        .message()
26        .device_key("QJ48vPutCAsPW2B6pE2A3a")
27        .title("正确的消息")
28        .body("这个消息有设备密钥")
29        .send();
30
31    match result {
32        Ok(response) => {
33            println!(
34                "✅ 消息发送成功: code={}, message={}",
35                response.code, response.message
36            );
37        }
38        Err(BarkError::RequestError(e)) => {
39            println!("❌ 网络请求错误: {}", e);
40        }
41        Err(BarkError::MissingDeviceKey) => {
42            println!("❌ 缺少设备密钥");
43        }
44        Err(BarkError::SerializationError(e)) => {
45            println!("❌ 序列化错误: {}", e);
46        }
47        Err(BarkError::InvalidUrl) => {
48            println!("❌ 无效URL");
49        }
50    }
51
52    println!("🎉 错误处理演示完成!");
53}
Source

pub fn device_keys(self, device_keys: Vec<String>) -> Self

设置多个设备密钥(批量推送)

详细说明请参见 BarkMessageBuilder::device_keys

Examples found in repository?
examples/batch_push.rs (lines 10-14)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
Source

pub fn level(self, level: Level) -> Self

设置推送级别

详细说明请参见 BarkMessageBuilder::level

Examples found in repository?
examples/batch_push.rs (line 17)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
More examples
Hide additional examples
examples/sync_client.rs (line 12)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端(带默认设备密钥)
5    let client = SyncBarkClient::with_device_key("https://api.day.app", "QJ48vPutCAsPW2B6pE2A3a");
6
7    // 方式1: 使用客户端的链式调用
8    let response = client
9        .message()
10        .title("同步推送")
11        .body("这是同步客户端发送的消息")
12        .level(Level::Active)
13        .volume(7)
14        .send()?;
15
16    println!(
17        "同步推送成功: code={}, message={}",
18        response.code, response.message
19    );
20
21    // 方式2: 先构建消息,再发送
22    let message = BarkMessage::builder()
23        .title("独立构建的消息")
24        .body("消息构建与发送分离")
25        .level(Level::Critical)
26        .sound("alarm")
27        .badge(1)
28        .build();
29
30    let response = client.send(&message)?;
31    println!(
32        "独立消息发送成功: code={}, message={}",
33        response.code, response.message
34    );
35
36    Ok(())
37}
Source

pub fn volume(self, volume: u8) -> Self

设置铃声音量 (1-10)

详细说明请参见 BarkMessageBuilder::volume

Examples found in repository?
examples/batch_push.rs (line 18)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
More examples
Hide additional examples
examples/sync_client.rs (line 13)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端(带默认设备密钥)
5    let client = SyncBarkClient::with_device_key("https://api.day.app", "QJ48vPutCAsPW2B6pE2A3a");
6
7    // 方式1: 使用客户端的链式调用
8    let response = client
9        .message()
10        .title("同步推送")
11        .body("这是同步客户端发送的消息")
12        .level(Level::Active)
13        .volume(7)
14        .send()?;
15
16    println!(
17        "同步推送成功: code={}, message={}",
18        response.code, response.message
19    );
20
21    // 方式2: 先构建消息,再发送
22    let message = BarkMessage::builder()
23        .title("独立构建的消息")
24        .body("消息构建与发送分离")
25        .level(Level::Critical)
26        .sound("alarm")
27        .badge(1)
28        .build();
29
30    let response = client.send(&message)?;
31    println!(
32        "独立消息发送成功: code={}, message={}",
33        response.code, response.message
34    );
35
36    Ok(())
37}
Source

pub fn badge(self, badge: u32) -> Self

设置应用角标数字

详细说明请参见 BarkMessageBuilder::badge

Examples found in repository?
examples/batch_push.rs (line 19)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
Source

pub fn call(self, call: bool) -> Self

设置是否重复播放铃声

详细说明请参见 BarkMessageBuilder::call

Source

pub fn auto_copy(self, auto_copy: bool) -> Self

设置是否自动复制推送内容

详细说明请参见 BarkMessageBuilder::auto_copy

Source

pub fn copy(self, copy: &str) -> Self

设置自定义复制内容

详细说明请参见 BarkMessageBuilder::copy

Source

pub fn sound(self, sound: &str) -> Self

设置铃声名称

详细说明请参见 BarkMessageBuilder::sound

Source

pub fn icon(self, icon: &str) -> Self

设置自定义图标

详细说明请参见 BarkMessageBuilder::icon

Source

pub fn group(self, group: &str) -> Self

设置消息分组

详细说明请参见 BarkMessageBuilder::group

Examples found in repository?
examples/batch_push.rs (line 20)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
Source

pub fn ciphertext(self, ciphertext: &str) -> Self

设置加密文本

详细说明请参见 BarkMessageBuilder::ciphertext

Source

pub fn is_archive(self, is_archive: bool) -> Self

设置是否保存到历史

详细说明请参见 BarkMessageBuilder::is_archive

Source

pub fn url(self, url: &str) -> Self

设置点击跳转 URL

详细说明请参见 BarkMessageBuilder::url

Source

pub fn action(self, action: &str) -> Self

设置动作类型

详细说明请参见 BarkMessageBuilder::action

Source

pub fn id(self, id: &str) -> Self

设置消息唯一标识

详细说明请参见 BarkMessageBuilder::id

Source

pub fn delete(self, delete: bool) -> Self

设置是否删除消息

详细说明请参见 BarkMessageBuilder::delete

Source

pub fn send(self) -> Result<BarkResponse>

构建并立即发送消息

这是一个便捷方法,相当于先调用 build() 再调用 SyncBarkClient::send

§返回值

成功时返回 BarkResponse,失败时返回 BarkError

§错误

可能返回的错误类型与 SyncBarkClient::send 相同。

§示例
use bark_rs::{SyncBarkClient, Level};

let client = SyncBarkClient::with_device_key("https://api.day.app", "key");

let response = client
    .message()
    .body("测试消息")
    .title("测试")
    .level(Level::Active)
    .send()?;

println!("发送成功: {}", response.message);
Examples found in repository?
examples/batch_push.rs (line 21)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端
5    let client = SyncBarkClient::new("https://api.day.app");
6
7    // 批量推送到多个设备
8    let response = client
9        .message()
10        .device_keys(vec![
11            "QJ48vPutCAsPW2B6pE2A3a".to_string(),
12            "device_key_2".to_string(),
13            "device_key_3".to_string(),
14        ])
15        .title("批量推送通知")
16        .body("这是一个发送给多个设备的批量消息")
17        .level(Level::TimeSensitive)
18        .volume(7)
19        .badge(1)
20        .group("批量通知")
21        .send()?;
22
23    println!(
24        "批量推送成功: code={}, message={}",
25        response.code, response.message
26    );
27
28    Ok(())
29}
More examples
Hide additional examples
examples/sync_client.rs (line 14)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4    // 创建同步客户端(带默认设备密钥)
5    let client = SyncBarkClient::with_device_key("https://api.day.app", "QJ48vPutCAsPW2B6pE2A3a");
6
7    // 方式1: 使用客户端的链式调用
8    let response = client
9        .message()
10        .title("同步推送")
11        .body("这是同步客户端发送的消息")
12        .level(Level::Active)
13        .volume(7)
14        .send()?;
15
16    println!(
17        "同步推送成功: code={}, message={}",
18        response.code, response.message
19    );
20
21    // 方式2: 先构建消息,再发送
22    let message = BarkMessage::builder()
23        .title("独立构建的消息")
24        .body("消息构建与发送分离")
25        .level(Level::Critical)
26        .sound("alarm")
27        .badge(1)
28        .build();
29
30    let response = client.send(&message)?;
31    println!(
32        "独立消息发送成功: code={}, message={}",
33        response.code, response.message
34    );
35
36    Ok(())
37}
examples/error_handling.rs (line 29)
3fn main() {
4    println!("🚨 演示错误处理");
5
6    // 创建没有默认设备密钥的客户端
7    let client = SyncBarkClient::new("https://api.day.app");
8
9    // 尝试发送没有设备密钥的消息
10    let message_without_key = BarkMessage::builder()
11        .title("错误演示")
12        .body("这个消息没有设备密钥")
13        .build();
14
15    match client.send(&message_without_key) {
16        Ok(_) => println!("❌ 意外成功"),
17        Err(BarkError::MissingDeviceKey) => {
18            println!("✅ 正确捕获到缺少设备密钥错误");
19        }
20        Err(e) => println!("❓ 其他错误: {}", e),
21    }
22
23    // 演示正确的错误处理模式
24    let result = client
25        .message()
26        .device_key("QJ48vPutCAsPW2B6pE2A3a")
27        .title("正确的消息")
28        .body("这个消息有设备密钥")
29        .send();
30
31    match result {
32        Ok(response) => {
33            println!(
34                "✅ 消息发送成功: code={}, message={}",
35                response.code, response.message
36            );
37        }
38        Err(BarkError::RequestError(e)) => {
39            println!("❌ 网络请求错误: {}", e);
40        }
41        Err(BarkError::MissingDeviceKey) => {
42            println!("❌ 缺少设备密钥");
43        }
44        Err(BarkError::SerializationError(e)) => {
45            println!("❌ 序列化错误: {}", e);
46        }
47        Err(BarkError::InvalidUrl) => {
48            println!("❌ 无效URL");
49        }
50    }
51
52    println!("🎉 错误处理演示完成!");
53}
Source

pub fn build(self) -> BarkMessage

构建消息对象而不发送

如果您需要先构建消息再由其他客户端发送,或者需要复用消息,可以使用这个方法。

§返回值

返回构建完成的 BarkMessage

§示例
use bark_rs::SyncBarkClient;

let client = SyncBarkClient::new("https://api.day.app");

let message = client
    .message()
    .body("消息内容")
    .title("消息标题")
    .build();

// 现在可以用不同的客户端发送这个消息

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,