Skip to main content

LiveClient

Struct LiveClient 

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

直播 API 客户端。

Implementations§

Source§

impl<'a> LiveClient<'a>

Source

pub async fn area_list(&self) -> BpiResult<Vec<LiveParentArea>>

获取全部直播分区分类。

Source

pub async fn room_info(&self, room_id: i64) -> BpiResult<RoomInfoData>

按真实房间 ID 获取公开房间信息。

Examples found in repository?
examples/live_room_info.rs (line 25)
22async fn main() -> BpiResult<()> {
23    let room_id = room_id()?;
24    let client = BpiClient::new()?;
25    let info = client.live().room_info(room_id).await?;
26
27    println!("直播间: {} ({})", info.title, info.room_id);
28    println!("主播 mid: {}", info.uid);
29    println!(
30        "状态: live_status={} 分区={}·{}",
31        info.live_status, info.parent_area_name, info.area_name
32    );
33    println!("在线: {} 关注: {}", info.online, info.attention);
34
35    Ok(())
36}
More examples
Hide additional examples
examples/live_web_start.rs (line 54)
36async fn main() -> BpiResult<()> {
37    let stop_if_live = std::env::args().any(|a| a == "--stop-if-live");
38    let stop_only = std::env::args().any(|a| a == "--stop-only");
39    let room_id: i64 = std::env::var("BILI_ROOM_ID")
40        .ok()
41        .and_then(|s| s.parse().ok())
42        .unwrap_or(DEFAULT_ROOM_ID);
43    let area_id: u64 = std::env::var("BILI_AREA_ID")
44        .ok()
45        .and_then(|s| s.parse().ok())
46        .unwrap_or(DEFAULT_AREA_ID);
47
48    let bpi = account::authenticated_client()?;
49
50    println!("=== Rust 网页自动开播验证 ===");
51    println!("room_id={room_id} area_v2={area_id}");
52
53    let live = bpi.live();
54    let info = live.room_info(room_id).await?;
55    println!(
56        "当前状态: live_status={} title={} area={}·{}",
57        info.live_status, info.title, info.parent_area_name, info.area_name
58    );
59
60    if !mutating_enabled() {
61        println!("{MUTATING_ENV}=1 未设置,只读取直播间状态,不执行开播、关播或获取推流码。");
62        return Ok(());
63    }
64
65    if stop_only {
66        if info.live_status == 1 {
67            println!("执行关播...");
68            let stop = live.live_stop(room_id as u64, "pc").await?;
69            println!("关播结果: status={}", stop.status);
70            tokio::time::sleep(std::time::Duration::from_secs(3)).await;
71        } else {
72            println!("当前未开播,跳过关播接口。");
73        }
74
75        let after = live.room_info(room_id).await?;
76        println!(
77            "验证: live_status={} ({})",
78            after.live_status,
79            if after.live_status == 0 {
80                "关播成功"
81            } else {
82                "仍在直播中"
83            }
84        );
85        return Ok(());
86    }
87
88    if info.live_status == 1 {
89        if stop_if_live {
90            println!("已在直播,--stop-if-live:先关播...");
91            let stop = live.live_stop(room_id as u64, "pc").await?;
92            println!("关播结果: status={}", stop.status);
93            tokio::time::sleep(std::time::Duration::from_secs(2)).await;
94        } else {
95            println!("已在直播中。若要完整验证开播链路,请加 --stop-if-live 或先手动关播。");
96            println!("仍尝试 FetchWebUpStreamAddr(只读)...");
97            let stream = live.live_fetch_web_up_stream_addr().await?;
98            println!("推流地址: {}{}", stream.addr.addr, mask(&stream.addr.code));
99            return Ok(());
100        }
101    }
102
103    println!("\n[1/2] FetchWebUpStreamAddr...");
104    let stream = live.live_fetch_web_up_stream_addr().await?;
105    println!("  rtmp: {}{}", stream.addr.addr, mask(&stream.addr.code));
106
107    println!("\n[2/2] WebLiveCenterStartLive (WBI)...");
108    let start = live.live_web_center_start(room_id as u64, area_id).await?;
109    println!("  status={} live_key={}", start.status, start.live_key);
110    if let Some(rtmp) = &start.rtmp {
111        println!("  rtmp(响应): {}{}", rtmp.addr, mask(&rtmp.code));
112    } else {
113        println!("  rtmp(响应): null(正常,推流码以 Fetch 为准)");
114    }
115
116    tokio::time::sleep(std::time::Duration::from_secs(2)).await;
117    let after = live.room_info(room_id).await?;
118    println!(
119        "\n验证: live_status={} ({})",
120        after.live_status,
121        if after.live_status == 1 {
122            "开播成功"
123        } else {
124            "未变为直播中(可能需 OBS 推流)"
125        }
126    );
127
128    Ok(())
129}
Source

pub async fn stream( &self, cid: i64, platform: Option<&str>, quality: Option<i32>, qn: Option<i32>, ) -> BpiResult<LiveStreamData>

按真实房间 ID 获取直播流 URL。

Source

pub async fn recommend(&self) -> BpiResult<RecommendData>

获取 Web 首页直播推荐列表。

Source

pub async fn version(&self) -> BpiResult<PcLiveVersionData>

获取当前 PC 直播客户端版本元数据。

Source

pub async fn gift_types(&self) -> BpiResult<Vec<GiftTypeItem>>

获取已登录账号的直播礼物类型列表。

Source

pub async fn room_gift_list( &self, room_id: i64, area_parent_id: Option<i32>, area_id: Option<i32>, ) -> BpiResult<RoomGiftData>

获取直播间礼物面板。

Source

pub async fn blind_gift_info(&self, gift_id: i64) -> BpiResult<BlindGiftData>

获取盲盒礼物概率详情。

Source

pub async fn danmu_info( &self, room_id: u64, info_type: u8, ) -> BpiResult<LiveDanmuInfoData>

获取直播 WebSocket 弹幕 token 和主机信息。

Source

pub async fn emoticons( &self, room_id: i64, platform: &str, ) -> BpiResult<EmoticonData>

获取直播间表情包。

Source

pub async fn lottery_info(&self, room_id: i64) -> BpiResult<LotteryInfoData>

获取直播间抽奖信息。

Source

pub async fn my_medals( &self, page: i32, page_size: i32, ) -> BpiResult<MyMedalsData>

获取当前账号的直播粉丝勋章。

Source

pub async fn follow_up_list( &self, page: Option<i32>, page_size: Option<i32>, ignore_record: Option<i32>, hit_ab: Option<bool>, ) -> BpiResult<FollowUpLiveData>

获取已关注主播及其直播状态。

Source

pub async fn follow_up_web_list( &self, hit_ab: Option<bool>, ) -> BpiResult<LiveWebListData>

获取当前正在直播的已关注主播。

Source

pub async fn replay_list( &self, page: Option<i32>, page_size: Option<i32>, ) -> BpiResult<ReplayListData>

获取当前账号的直播回放列表。

Source

pub async fn guard_list( &self, room_id: i64, ruid: i64, page: Option<i32>, page_size: Option<i32>, typ: Option<i32>, ) -> BpiResult<GuardListData>

获取直播间的大航海成员。

Source

pub async fn silent_users( &self, params: LiveSilentUserListParams, ) -> BpiResult<SilentUserListData>

获取直播间禁言用户。

Source

pub async fn banned_users( &self, params: LiveBannedUserListParams, ) -> BpiResult<BannedUserListData>

获取直播主播的封禁用户。

Source

pub async fn shield_keywords( &self, params: LiveShieldKeywordListParams, ) -> BpiResult<ShieldKeywordListData>

获取直播间屏蔽关键词。

Source

pub async fn web_heart_beat( &self, params: LiveWebHeartBeatParams, ) -> BpiResult<HeartBeatData>

发送用于直播遥测的 Web 心跳。

Source§

impl<'a> LiveClient<'a>

Source

pub async fn live_send_danmu( &self, room_id: u64, message: &str, color: Option<u32>, font_size: Option<u32>, ) -> BpiResult<SendDanmuData>

发送直播间弹幕

§参数
  • room_id - 直播间 ID
  • message - 弹幕内容
  • color - 十进制颜色值,默认 16777215 (白色)
  • font_size - 字体大小,默认 25
Source§

impl<'a> LiveClient<'a>

Source

pub async fn live_create_room(&self) -> BpiResult<CreateRoomData>

开通直播间

Source

pub async fn live_update_room_info( &self, room_id: u64, title: Option<&str>, area_id: Option<u64>, add_tag: Option<&str>, del_tag: Option<&str>, ) -> BpiResult<UpdateRoomData>

更新直播间信息

§参数
  • room_id - 直播间 ID
  • title - 标题,可选
  • area_id - 分区 ID,可选
  • add_tag - 要添加的标签,可选
  • del_tag - 要删除的标签,可选
Source

pub async fn live_fetch_web_up_stream_addr( &self, ) -> BpiResult<WebUpStreamAddrData>

获取网页 link 中心推流地址

Examples found in repository?
examples/live_web_start.rs (line 97)
36async fn main() -> BpiResult<()> {
37    let stop_if_live = std::env::args().any(|a| a == "--stop-if-live");
38    let stop_only = std::env::args().any(|a| a == "--stop-only");
39    let room_id: i64 = std::env::var("BILI_ROOM_ID")
40        .ok()
41        .and_then(|s| s.parse().ok())
42        .unwrap_or(DEFAULT_ROOM_ID);
43    let area_id: u64 = std::env::var("BILI_AREA_ID")
44        .ok()
45        .and_then(|s| s.parse().ok())
46        .unwrap_or(DEFAULT_AREA_ID);
47
48    let bpi = account::authenticated_client()?;
49
50    println!("=== Rust 网页自动开播验证 ===");
51    println!("room_id={room_id} area_v2={area_id}");
52
53    let live = bpi.live();
54    let info = live.room_info(room_id).await?;
55    println!(
56        "当前状态: live_status={} title={} area={}·{}",
57        info.live_status, info.title, info.parent_area_name, info.area_name
58    );
59
60    if !mutating_enabled() {
61        println!("{MUTATING_ENV}=1 未设置,只读取直播间状态,不执行开播、关播或获取推流码。");
62        return Ok(());
63    }
64
65    if stop_only {
66        if info.live_status == 1 {
67            println!("执行关播...");
68            let stop = live.live_stop(room_id as u64, "pc").await?;
69            println!("关播结果: status={}", stop.status);
70            tokio::time::sleep(std::time::Duration::from_secs(3)).await;
71        } else {
72            println!("当前未开播,跳过关播接口。");
73        }
74
75        let after = live.room_info(room_id).await?;
76        println!(
77            "验证: live_status={} ({})",
78            after.live_status,
79            if after.live_status == 0 {
80                "关播成功"
81            } else {
82                "仍在直播中"
83            }
84        );
85        return Ok(());
86    }
87
88    if info.live_status == 1 {
89        if stop_if_live {
90            println!("已在直播,--stop-if-live:先关播...");
91            let stop = live.live_stop(room_id as u64, "pc").await?;
92            println!("关播结果: status={}", stop.status);
93            tokio::time::sleep(std::time::Duration::from_secs(2)).await;
94        } else {
95            println!("已在直播中。若要完整验证开播链路,请加 --stop-if-live 或先手动关播。");
96            println!("仍尝试 FetchWebUpStreamAddr(只读)...");
97            let stream = live.live_fetch_web_up_stream_addr().await?;
98            println!("推流地址: {}{}", stream.addr.addr, mask(&stream.addr.code));
99            return Ok(());
100        }
101    }
102
103    println!("\n[1/2] FetchWebUpStreamAddr...");
104    let stream = live.live_fetch_web_up_stream_addr().await?;
105    println!("  rtmp: {}{}", stream.addr.addr, mask(&stream.addr.code));
106
107    println!("\n[2/2] WebLiveCenterStartLive (WBI)...");
108    let start = live.live_web_center_start(room_id as u64, area_id).await?;
109    println!("  status={} live_key={}", start.status, start.live_key);
110    if let Some(rtmp) = &start.rtmp {
111        println!("  rtmp(响应): {}{}", rtmp.addr, mask(&rtmp.code));
112    } else {
113        println!("  rtmp(响应): null(正常,推流码以 Fetch 为准)");
114    }
115
116    tokio::time::sleep(std::time::Duration::from_secs(2)).await;
117    let after = live.room_info(room_id).await?;
118    println!(
119        "\n验证: live_status={} ({})",
120        after.live_status,
121        if after.live_status == 1 {
122            "开播成功"
123        } else {
124            "未变为直播中(可能需 OBS 推流)"
125        }
126    );
127
128    Ok(())
129}
Source

pub async fn live_web_center_start( &self, room_id: u64, area_v2: u64, ) -> BpiResult<StartLiveData>

网页 link 中心开始直播(第三方软件开播,WBI 签名)

Examples found in repository?
examples/live_web_start.rs (line 108)
36async fn main() -> BpiResult<()> {
37    let stop_if_live = std::env::args().any(|a| a == "--stop-if-live");
38    let stop_only = std::env::args().any(|a| a == "--stop-only");
39    let room_id: i64 = std::env::var("BILI_ROOM_ID")
40        .ok()
41        .and_then(|s| s.parse().ok())
42        .unwrap_or(DEFAULT_ROOM_ID);
43    let area_id: u64 = std::env::var("BILI_AREA_ID")
44        .ok()
45        .and_then(|s| s.parse().ok())
46        .unwrap_or(DEFAULT_AREA_ID);
47
48    let bpi = account::authenticated_client()?;
49
50    println!("=== Rust 网页自动开播验证 ===");
51    println!("room_id={room_id} area_v2={area_id}");
52
53    let live = bpi.live();
54    let info = live.room_info(room_id).await?;
55    println!(
56        "当前状态: live_status={} title={} area={}·{}",
57        info.live_status, info.title, info.parent_area_name, info.area_name
58    );
59
60    if !mutating_enabled() {
61        println!("{MUTATING_ENV}=1 未设置,只读取直播间状态,不执行开播、关播或获取推流码。");
62        return Ok(());
63    }
64
65    if stop_only {
66        if info.live_status == 1 {
67            println!("执行关播...");
68            let stop = live.live_stop(room_id as u64, "pc").await?;
69            println!("关播结果: status={}", stop.status);
70            tokio::time::sleep(std::time::Duration::from_secs(3)).await;
71        } else {
72            println!("当前未开播,跳过关播接口。");
73        }
74
75        let after = live.room_info(room_id).await?;
76        println!(
77            "验证: live_status={} ({})",
78            after.live_status,
79            if after.live_status == 0 {
80                "关播成功"
81            } else {
82                "仍在直播中"
83            }
84        );
85        return Ok(());
86    }
87
88    if info.live_status == 1 {
89        if stop_if_live {
90            println!("已在直播,--stop-if-live:先关播...");
91            let stop = live.live_stop(room_id as u64, "pc").await?;
92            println!("关播结果: status={}", stop.status);
93            tokio::time::sleep(std::time::Duration::from_secs(2)).await;
94        } else {
95            println!("已在直播中。若要完整验证开播链路,请加 --stop-if-live 或先手动关播。");
96            println!("仍尝试 FetchWebUpStreamAddr(只读)...");
97            let stream = live.live_fetch_web_up_stream_addr().await?;
98            println!("推流地址: {}{}", stream.addr.addr, mask(&stream.addr.code));
99            return Ok(());
100        }
101    }
102
103    println!("\n[1/2] FetchWebUpStreamAddr...");
104    let stream = live.live_fetch_web_up_stream_addr().await?;
105    println!("  rtmp: {}{}", stream.addr.addr, mask(&stream.addr.code));
106
107    println!("\n[2/2] WebLiveCenterStartLive (WBI)...");
108    let start = live.live_web_center_start(room_id as u64, area_id).await?;
109    println!("  status={} live_key={}", start.status, start.live_key);
110    if let Some(rtmp) = &start.rtmp {
111        println!("  rtmp(响应): {}{}", rtmp.addr, mask(&rtmp.code));
112    } else {
113        println!("  rtmp(响应): null(正常,推流码以 Fetch 为准)");
114    }
115
116    tokio::time::sleep(std::time::Duration::from_secs(2)).await;
117    let after = live.room_info(room_id).await?;
118    println!(
119        "\n验证: live_status={} ({})",
120        after.live_status,
121        if after.live_status == 1 {
122            "开播成功"
123        } else {
124            "未变为直播中(可能需 OBS 推流)"
125        }
126    );
127
128    Ok(())
129}
Source

pub async fn live_stop( &self, room_id: u64, platform: &str, ) -> BpiResult<StopLiveData>

关闭直播

§参数
  • room_id - 直播间 ID
  • platform - 直播平台,如 “pc_link”
Examples found in repository?
examples/live_web_start.rs (line 68)
36async fn main() -> BpiResult<()> {
37    let stop_if_live = std::env::args().any(|a| a == "--stop-if-live");
38    let stop_only = std::env::args().any(|a| a == "--stop-only");
39    let room_id: i64 = std::env::var("BILI_ROOM_ID")
40        .ok()
41        .and_then(|s| s.parse().ok())
42        .unwrap_or(DEFAULT_ROOM_ID);
43    let area_id: u64 = std::env::var("BILI_AREA_ID")
44        .ok()
45        .and_then(|s| s.parse().ok())
46        .unwrap_or(DEFAULT_AREA_ID);
47
48    let bpi = account::authenticated_client()?;
49
50    println!("=== Rust 网页自动开播验证 ===");
51    println!("room_id={room_id} area_v2={area_id}");
52
53    let live = bpi.live();
54    let info = live.room_info(room_id).await?;
55    println!(
56        "当前状态: live_status={} title={} area={}·{}",
57        info.live_status, info.title, info.parent_area_name, info.area_name
58    );
59
60    if !mutating_enabled() {
61        println!("{MUTATING_ENV}=1 未设置,只读取直播间状态,不执行开播、关播或获取推流码。");
62        return Ok(());
63    }
64
65    if stop_only {
66        if info.live_status == 1 {
67            println!("执行关播...");
68            let stop = live.live_stop(room_id as u64, "pc").await?;
69            println!("关播结果: status={}", stop.status);
70            tokio::time::sleep(std::time::Duration::from_secs(3)).await;
71        } else {
72            println!("当前未开播,跳过关播接口。");
73        }
74
75        let after = live.room_info(room_id).await?;
76        println!(
77            "验证: live_status={} ({})",
78            after.live_status,
79            if after.live_status == 0 {
80                "关播成功"
81            } else {
82                "仍在直播中"
83            }
84        );
85        return Ok(());
86    }
87
88    if info.live_status == 1 {
89        if stop_if_live {
90            println!("已在直播,--stop-if-live:先关播...");
91            let stop = live.live_stop(room_id as u64, "pc").await?;
92            println!("关播结果: status={}", stop.status);
93            tokio::time::sleep(std::time::Duration::from_secs(2)).await;
94        } else {
95            println!("已在直播中。若要完整验证开播链路,请加 --stop-if-live 或先手动关播。");
96            println!("仍尝试 FetchWebUpStreamAddr(只读)...");
97            let stream = live.live_fetch_web_up_stream_addr().await?;
98            println!("推流地址: {}{}", stream.addr.addr, mask(&stream.addr.code));
99            return Ok(());
100        }
101    }
102
103    println!("\n[1/2] FetchWebUpStreamAddr...");
104    let stream = live.live_fetch_web_up_stream_addr().await?;
105    println!("  rtmp: {}{}", stream.addr.addr, mask(&stream.addr.code));
106
107    println!("\n[2/2] WebLiveCenterStartLive (WBI)...");
108    let start = live.live_web_center_start(room_id as u64, area_id).await?;
109    println!("  status={} live_key={}", start.status, start.live_key);
110    if let Some(rtmp) = &start.rtmp {
111        println!("  rtmp(响应): {}{}", rtmp.addr, mask(&rtmp.code));
112    } else {
113        println!("  rtmp(响应): null(正常,推流码以 Fetch 为准)");
114    }
115
116    tokio::time::sleep(std::time::Duration::from_secs(2)).await;
117    let after = live.room_info(room_id).await?;
118    println!(
119        "\n验证: live_status={} ({})",
120        after.live_status,
121        if after.live_status == 1 {
122            "开播成功"
123        } else {
124            "未变为直播中(可能需 OBS 推流)"
125        }
126    );
127
128    Ok(())
129}
Source

pub async fn live_update_pre_live_info( &self, title: Option<&str>, cover: Option<&str>, ) -> BpiResult<UpdatePreLiveInfoData>

预更新直播间信息

§参数
  • title - 标题,可选
  • cover - 封面 URL,可选
Source

pub async fn live_update_room_news( &self, room_id: u64, uid: u64, content: &str, ) -> BpiResult<Value>

更新直播间公告

§参数
  • room_id - 直播间 ID
  • uid - 用户ID
  • content - 公告内容
Source§

impl<'a> LiveClient<'a>

Source

pub async fn live_add_silent_user( &self, room_id: i64, tuid: i64, hour: i32, msg: Option<String>, ) -> BpiResult<Option<Value>>

禁言观众 tuid: 用户uid hour: -1永久 0本场直播 msg: 禁言理由,一般为禁言的弹幕,选填

Source

pub async fn live_del_block_user( &self, roomid: i64, tuid: i64, ) -> BpiResult<Option<Value>>

解除禁言

Source

pub async fn live_add_banned_user( &self, room_id: i64, anchor_id: i64, tuid: i64, ) -> BpiResult<Option<Value>>

拉黑观众 anchor_id:主播uid

Source

pub async fn live_del_banned_user( &self, room_id: i64, anchor_id: i64, tuid: i64, ) -> BpiResult<Option<Value>>

解除拉黑 anchor_id:主播uid

Source

pub async fn live_add_shield_keyword( &self, room_id: i64, keyword: String, ) -> BpiResult<Option<Value>>

添加屏蔽词

Source

pub async fn live_del_shield_keyword( &self, room_id: i64, keyword: String, ) -> BpiResult<Option<Value>>

删除屏蔽词

Trait Implementations§

Source§

impl<'a> Clone for LiveClient<'a>

Source§

fn clone(&self) -> LiveClient<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for LiveClient<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LiveClient<'a>

§

impl<'a> !UnwindSafe for LiveClient<'a>

§

impl<'a> Freeze for LiveClient<'a>

§

impl<'a> Send for LiveClient<'a>

§

impl<'a> Sync for LiveClient<'a>

§

impl<'a> Unpin for LiveClient<'a>

§

impl<'a> UnsafeUnpin for LiveClient<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

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: Sized + 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: Sized + 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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