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: usize
Implementations§
Source§impl<'a, M: MediaItem> Part<'a, M>
impl<'a, M: MediaItem> Part<'a, M>
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.
Source§impl<'a, M: MediaItemWithTranscoding> Part<'a, M>
impl<'a, M: MediaItemWithTranscoding> Part<'a, M>
Sourcepub async fn create_download_session(
&self,
options: M::Options,
) -> Result<TranscodeSession>
pub async fn create_download_session( &self, options: M::Options, ) -> Result<TranscodeSession>
Starts an offline transcode using the provided options.
The server may refuse to transcode if the options suggest that the original media file can be played back directly.
Can’t be called on media other than Movie, Episode or Track.
Sourcepub async fn create_streaming_session(
&self,
protocol: Protocol,
options: M::Options,
) -> Result<TranscodeSession>
pub 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.
Can’t be called on media other than Movie, Episode or Track.
Trait Implementations§
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