pub struct VideoDescParams { /* private fields */ }Expand description
/x/web-interface/archive/desc 的参数。
Implementations§
Source§impl VideoDescParams
impl VideoDescParams
Sourcepub fn from_bvid(bvid: Bvid) -> Self
pub fn from_bvid(bvid: Bvid) -> Self
使用已验证的 BV ID 创建简介参数。
Examples found in repository?
examples/video_info.rs (line 40)
21async fn main() -> BpiResult<()> {
22 let bvid = video_bvid()?;
23 let client = BpiClient::new()?;
24 let video = client.video();
25
26 let view = video.view(VideoViewParams::from_bvid(bvid.clone())).await?;
27 println!(
28 "视频: {} ({}) UP={} 播放={} 点赞={}",
29 view.title, view.bvid, view.owner.name, view.stat.view, view.stat.like
30 );
31
32 let pages = video
33 .page_list(VideoPageListParams::from_bvid(bvid.clone()))
34 .await?;
35 println!("分 P 数: {}", pages.len());
36 for page in pages.iter().take(5) {
37 println!(" P{} cid={} {}", page.page, page.cid, page.part);
38 }
39
40 let desc = video.desc(VideoDescParams::from_bvid(bvid)).await?;
41 let first_line = desc.lines().next().unwrap_or("");
42 println!("简介首行: {first_line}");
43
44 Ok(())
45}Trait Implementations§
Source§impl Clone for VideoDescParams
impl Clone for VideoDescParams
Source§fn clone(&self) -> VideoDescParams
fn clone(&self) -> VideoDescParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VideoDescParams
impl Debug for VideoDescParams
impl Eq for VideoDescParams
Source§impl PartialEq for VideoDescParams
impl PartialEq for VideoDescParams
Source§fn eq(&self, other: &VideoDescParams) -> bool
fn eq(&self, other: &VideoDescParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VideoDescParams
Auto Trait Implementations§
impl Freeze for VideoDescParams
impl RefUnwindSafe for VideoDescParams
impl Send for VideoDescParams
impl Sync for VideoDescParams
impl Unpin for VideoDescParams
impl UnsafeUnpin for VideoDescParams
impl UnwindSafe for VideoDescParams
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