pub struct VideoViewParams { /* private fields */ }Expand description
Parameters for /x/web-interface/view.
Implementations§
Source§impl VideoViewParams
impl VideoViewParams
Sourcepub fn from_bvid(bvid: Bvid) -> Self
pub fn from_bvid(bvid: Bvid) -> Self
Creates view parameters from a validated BV ID.
Examples found in repository?
examples/module_clients.rs (line 11)
9async fn main() -> BpiResult<()> {
10 let client = client_from_env()?;
11 let video_params = VideoViewParams::from_bvid("BV1xx411c7mD".parse::<Bvid>()?);
12 let bangumi_params = BangumiInfoParams::new(MediaId::new(28_220_978)?);
13
14 if !run_live_example() {
15 println!("module-client quickstart compiled; set BPI_RUN_EXAMPLE=1 to call live APIs");
16 return Ok(());
17 }
18
19 let video = client.video().view(video_params).await?;
20 println!("video: {}", video.title);
21
22 let bangumi = client.bangumi().info(bangumi_params).await?;
23 println!("bangumi: {}", bangumi.media.title);
24
25 if env::var_os("BPI_COOKIE").is_some() {
26 let nav = client.login().nav().await?;
27 println!("logged in: {}", nav.is_login);
28 }
29
30 Ok(())
31}Trait Implementations§
Source§impl Clone for VideoViewParams
impl Clone for VideoViewParams
Source§fn clone(&self) -> VideoViewParams
fn clone(&self) -> VideoViewParams
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 VideoViewParams
impl Debug for VideoViewParams
impl Eq for VideoViewParams
Source§impl PartialEq for VideoViewParams
impl PartialEq for VideoViewParams
Source§fn eq(&self, other: &VideoViewParams) -> bool
fn eq(&self, other: &VideoViewParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VideoViewParams
Auto Trait Implementations§
impl Freeze for VideoViewParams
impl RefUnwindSafe for VideoViewParams
impl Send for VideoViewParams
impl Sync for VideoViewParams
impl Unpin for VideoViewParams
impl UnsafeUnpin for VideoViewParams
impl UnwindSafe for VideoViewParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.