pub struct Part<'a, M: MediaItem> {
pub media_index: usize,
pub part_index: usize,
/* private fields */
}Expand description
One part of a Media.
Fields§
§media_index: usize§part_index: usizeImplementations§
Source§impl<'a, M: MediaItem> Part<'a, M>
impl<'a, M: MediaItem> Part<'a, M>
pub fn duration(&self) -> Option<u64>
Sourcepub async fn download<W, R>(&self, writer: W, range: R) -> Result
pub async fn download<W, R>(&self, writer: W, range: R) -> Result
Downloads the original media file for this part writing the data into the provided writer. A range of bytes within the file can be requested allowing for resumable transfers.
Configured timeout value will be ignored during downloading.
Sourcepub fn metadata(&self) -> &PartMetadata
pub fn metadata(&self) -> &PartMetadata
The internal metadata for the media.
Trait Implementations§
Source§impl<'a, M: Transcodable + MediaItem + Sync> Transcodable for Part<'a, M>
impl<'a, M: Transcodable + MediaItem + Sync> Transcodable for Part<'a, M>
type Options = <M as Transcodable>::Options
Source§async fn create_download_session(
&self,
options: M::Options,
) -> Result<TranscodeSession>
async fn create_download_session( &self, options: M::Options, ) -> Result<TranscodeSession>
Starts an offline transcode using the provided options. Read more
Source§async fn create_streaming_session(
&self,
protocol: Protocol,
options: M::Options,
) -> Result<TranscodeSession>
async fn create_streaming_session( &self, protocol: Protocol, options: M::Options, ) -> Result<TranscodeSession>
Starts a streaming transcode using of the given media part using the
streaming protocol and provided options. Read more
Source§async fn queue_download(
&self,
options: Self::Options,
download_queue: Option<&DownloadQueue>,
) -> Result<QueueItem>
async fn queue_download( &self, options: Self::Options, download_queue: Option<&DownloadQueue>, ) -> Result<QueueItem>
Queues this item for download using the provided download queue. Read more
Auto Trait Implementations§
impl<'a, M> Freeze for Part<'a, M>
impl<'a, M> !RefUnwindSafe for Part<'a, M>
impl<'a, M> Send for Part<'a, M>where
M: Send,
impl<'a, M> Sync for Part<'a, M>where
M: Sync,
impl<'a, M> Unpin for Part<'a, M>where
M: Unpin,
impl<'a, M> !UnwindSafe for Part<'a, M>
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