Struct rustube::Stream[][src]

pub struct Stream {
Show fields pub mime: Mime, pub codecs: Vec<String>, pub is_progressive: bool, pub includes_video_track: bool, pub includes_audio_track: bool, pub format_type: Option<FormatType>, pub approx_duration_ms: Option<u64>, pub audio_channels: Option<u8>, pub audio_quality: Option<AudioQuality>, pub audio_sample_rate: Option<u64>, pub average_bitrate: Option<u64>, pub bitrate: Option<u64>, pub color_info: Option<ColorInfo>, pub fps: u8, pub height: Option<u64>, pub high_replication: Option<bool>, pub index_range: Option<Range<u64>>, pub init_range: Option<Range<u64>>, pub is_otf: bool, pub itag: u64, pub last_modified: DateTime<Utc>, pub loudness_db: Option<f64>, pub projection_type: ProjectionType, pub quality: Quality, pub quality_label: Option<QualityLabel>, pub signature_cipher: SignatureCipher, pub width: Option<u64>, pub video_details: Arc<VideoDetails>, // some fields omitted
}
Expand description

A downloadable video Stream, that contains all the important information.

Fields

mime: Mimecodecs: Vec<String>is_progressive: boolincludes_video_track: boolincludes_audio_track: boolformat_type: Option<FormatType>approx_duration_ms: Option<u64>audio_channels: Option<u8>audio_quality: Option<AudioQuality>audio_sample_rate: Option<u64>average_bitrate: Option<u64>bitrate: Option<u64>color_info: Option<ColorInfo>fps: u8height: Option<u64>high_replication: Option<bool>index_range: Option<Range<u64>>init_range: Option<Range<u64>>is_otf: boolitag: u64last_modified: DateTime<Utc>loudness_db: Option<f64>projection_type: ProjectionTypequality: Qualityquality_label: Option<QualityLabel>signature_cipher: SignatureCipherwidth: Option<u64>video_details: Arc<VideoDetails>

Implementations

impl Stream[src]

pub async fn download_with_callback(
    &self,
    callback: Callback
) -> Result<PathBuf>
[src]

This is supported on crate features stream and callback only.

Attempts to downloads the Streams resource. This will download the video to <video_id>.mp4 in the current working directory. Takes an Callback

pub async fn download_to_dir_with_callback<P: AsRef<Path>>(
    &self,
    dir: P,
    callback: Callback
) -> Result<PathBuf>
[src]

This is supported on crate features stream and callback only.

Attempts to downloads the Streams resource. This will download the video to <video_id>.mp4 in the provided directory. Takes an Callback

pub async fn download_to_with_callback<P: AsRef<Path>>(
    &self,
    path: P,
    callback: Callback
) -> Result<()>
[src]

This is supported on crate features stream and callback only.

Attempts to downloads the Streams resource. This will download the video to the provided file path. Takes an Callback

impl Stream[src]

pub async fn content_length(&self) -> Result<u64>[src]

This is supported on crate features stream and download only.

The content length of the video. If the content length was not included in the RawFormat, this method will make a HEAD request, to try to figure it out.

Errors:

  • When the content length was not included in the RawFormat, and the request fails.

pub async fn download(&self) -> Result<PathBuf>[src]

This is supported on crate features stream and download only.

Attempts to downloads the Streams resource. This will download the video to <video_id>.mp4 in the current working directory.

pub async fn download_to_dir<P: AsRef<Path>>(&self, dir: P) -> Result<PathBuf>[src]

This is supported on crate features stream and download only.

Attempts to downloads the Streams resource. This will download the video to <video_id>.mp4 in the provided directory.

pub async fn download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

This is supported on crate features stream and download only.

Attempts to downloads the Streams resource. This will download the video to the provided file path.

impl Stream[src]

pub fn blocking_download(&self) -> Result<PathBuf>[src]

This is supported on crate features download and blocking and stream only.

A synchronous wrapper around Stream::download.

pub fn blocking_download_with_callback(
    &self,
    callback: Callback
) -> Result<PathBuf>
[src]

This is supported on crate features download and blocking and stream and callback only.

A synchronous wrapper around Stream::download_with_callback.

pub fn blocking_download_to_dir<P: AsRef<Path>>(
    &self,
    dir: P
) -> Result<PathBuf>
[src]

This is supported on crate features download and blocking and stream only.

A synchronous wrapper around Stream::download_to_dir.

pub fn blocking_download_to_dir_with_callback<P: AsRef<Path>>(
    &self,
    dir: P,
    callback: Callback
) -> Result<PathBuf>
[src]

This is supported on crate features download and blocking and stream and callback only.

A synchronous wrapper around Stream::download_to_dir_with_callback.

pub fn blocking_download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

This is supported on crate features download and blocking and stream only.

A synchronous wrapper around Stream::download_to.

pub fn blocking_download_to_with_callback<P: AsRef<Path>>(
    &self,
    path: P,
    callback: Callback
) -> Result<()>
[src]

This is supported on crate features download and blocking and stream and callback only.

A synchronous wrapper around Stream::download_to_with_callback.

pub fn blocking_content_length(&self) -> Result<u64>[src]

This is supported on crate features download and blocking and stream only.

A synchronous wrapper around Stream::content_length.

Trait Implementations

impl Clone for Stream[src]

This is supported on crate feature stream only.

fn clone(&self) -> Stream[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Stream[src]

This is supported on crate feature stream only.

fn fmt(&self, __f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for Stream[src]

This is supported on crate feature stream only.

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<Stream> for Stream[src]

This is supported on crate feature stream only.

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Serialize for Stream[src]

This is supported on crate feature stream only.

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Stream

impl Send for Stream

impl Sync for Stream

impl Unpin for Stream

impl !UnwindSafe for Stream

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]