Struct rustube::Stream [−][src]
A downloadable video Stream, that contains all the important information.
Fields
mime: Mime
codecs: Vec<String>
is_progressive: bool
includes_video_track: bool
includes_audio_track: bool
format_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: u8
height: Option<u64>
high_replication: Option<bool>
index_range: Option<Range<u64>>
init_range: Option<Range<u64>>
is_otf: bool
itag: u64
last_modified: DateTime<Utc>
loudness_db: Option<f64>
projection_type: ProjectionType
quality: Quality
quality_label: Option<QualityLabel>
signature_cipher: SignatureCipher
width: Option<u64>
video_details: Arc<VideoDetails>
Implementations
impl Stream
[src]
pub async fn content_length(&self) -> Result<u64>
[src]
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]
stream
and download
only.Attempts to downloads the Stream
s resource.
This will download the video to <video_id>.mp4 in the current working directory.
pub async fn download_callback(&self, callback: Callback) -> Result<PathBuf>
[src]
stream
and download
and callback
only.Attempts to downloads the Stream
s resource.
This will download the video to <video_id>.mp4 in the current working directory.
Takes an Callback
pub async fn download_to_dir<P: AsRef<Path>>(&self, dir: P) -> Result<PathBuf>
[src]
stream
and download
only.Attempts to downloads the Stream
s resource.
This will download the video to <video_id>.mp4 in the provided directory.
pub async fn download_to_dir_callback<P: AsRef<Path>>(
&self,
dir: P,
callback: Callback
) -> Result<PathBuf>
[src]
&self,
dir: P,
callback: Callback
) -> Result<PathBuf>
stream
and download
and callback
only.Attempts to downloads the Stream
s resource.
This will download the video to <video_id>.mp4 in the provided directory.
Takes an Callback
pub async fn download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>
[src]
stream
and download
only.Attempts to downloads the Stream
s resource.
This will download the video to the provided file path.
pub async fn download_to_callback<P: AsRef<Path>>(
&self,
path: P,
callback: Callback
) -> Result<()>
[src]
&self,
path: P,
callback: Callback
) -> Result<()>
stream
and download
and callback
only.impl Stream
[src]
pub fn blocking_download(&self) -> Result<PathBuf>
[src]
stream
and blocking
only.A synchronous wrapper around Stream::download
.
pub fn blocking_download_callback(&self, callback: Callback) -> Result<PathBuf>
[src]
stream
and blocking
and callback
only.A synchronous wrapper around Stream::download_callback
.
pub fn blocking_download_to_dir<P: AsRef<Path>>(
&self,
dir: P
) -> Result<PathBuf>
[src]
&self,
dir: P
) -> Result<PathBuf>
stream
and blocking
only.A synchronous wrapper around Stream::download_to_dir
.
pub fn blocking_download_to_dir_callback<P: AsRef<Path>>(
&self,
dir: P,
callback: Callback
) -> Result<PathBuf>
[src]
&self,
dir: P,
callback: Callback
) -> Result<PathBuf>
stream
and blocking
and callback
only.A synchronous wrapper around Stream::download_to_dir_callback
.
pub fn blocking_download_to<P: AsRef<Path>>(&self, path: P) -> Result<()>
[src]
stream
and blocking
only.A synchronous wrapper around Stream::download_to
.
pub fn blocking_download_to_callback<P: AsRef<Path>>(
&self,
path: P,
callback: Callback
) -> Result<()>
[src]
&self,
path: P,
callback: Callback
) -> Result<()>
stream
and blocking
and callback
only.A synchronous wrapper around Stream::download_to_callback
.
pub fn blocking_content_length(&self) -> Result<u64>
[src]
stream
and blocking
only.A synchronous wrapper around Stream::content_length
.
Trait Implementations
impl Clone for Stream
[src]
stream
only.impl Debug for Stream
[src]
stream
only.impl PartialEq<Stream> for Stream
[src]
stream
only.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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,