pub struct QueueItem { /* private fields */ }Expand description
An item in a download queue.
Implementations§
Source§impl QueueItem
impl QueueItem
pub fn id(&self) -> u32
pub fn queue(&self) -> DownloadQueue
pub fn key(&self) -> &str
pub fn status(&self) -> QueueItemStatus
Sourcepub fn stats(&self) -> Option<TranscodeSessionStats>
pub fn stats(&self) -> Option<TranscodeSessionStats>
If this item is currently being transcoded this will return the current transcode stats.
Sourcepub fn error(&self) -> Option<&str>
pub fn error(&self) -> Option<&str>
If the status is an error this may reveal more information.
Sourcepub fn is_transcode(&self) -> bool
pub fn is_transcode(&self) -> bool
Returns true if this item was or is being transcoded. If false then downloading will just download the original media file.
Sourcepub async fn container(&self) -> Result<ContainerFormat>
pub async fn container(&self) -> Result<ContainerFormat>
Returns the container format of the file that will be downloaded.
This will fail if the item is not available.
Sourcepub async fn content_length(&self) -> Result<Option<u64>>
pub async fn content_length(&self) -> Result<Option<u64>>
Returns the expected length of the download.
This will fail if the item is not available.
Sourcepub async fn update(&mut self) -> Result<()>
pub async fn update(&mut self) -> Result<()>
Updates the state of this item by re-fetching it from the server.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueueItem
impl !RefUnwindSafe for QueueItem
impl Send for QueueItem
impl Sync for QueueItem
impl Unpin for QueueItem
impl !UnwindSafe for QueueItem
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