pub struct PlaybackProgress {
pub position: Duration,
pub duration: Option<Duration>,
pub buffered: Duration,
}Expand description
Where the open item is.
Fields§
§position: DurationHow far in the item playback has reached.
duration: Option<Duration>The item’s length, or None for a stream that has none.
buffered: DurationHow far ahead of the position the buffer reaches. Equal to duration
for a local file, which is what makes a local file’s buffer bar full.
Implementations§
Source§impl PlaybackProgress
impl PlaybackProgress
Sourcepub fn new(position: Duration, duration: Duration) -> PlaybackProgress
pub fn new(position: Duration, duration: Duration) -> PlaybackProgress
Progress through an item of known length.
Sourcepub fn fraction(&self) -> Option<f32>
pub fn fraction(&self) -> Option<f32>
How far through the item this is, or None when it has no length.
Sourcepub fn buffered_fraction(&self) -> Option<f32>
pub fn buffered_fraction(&self) -> Option<f32>
How much of the item is buffered, or None when it has no length.
Trait Implementations§
Source§impl Clone for PlaybackProgress
impl Clone for PlaybackProgress
impl Copy for PlaybackProgress
Source§impl Debug for PlaybackProgress
impl Debug for PlaybackProgress
Source§impl Default for PlaybackProgress
impl Default for PlaybackProgress
impl Eq for PlaybackProgress
Source§impl Hash for PlaybackProgress
impl Hash for PlaybackProgress
Source§impl PartialEq for PlaybackProgress
impl PartialEq for PlaybackProgress
impl StructuralPartialEq for PlaybackProgress
Auto Trait Implementations§
impl Freeze for PlaybackProgress
impl RefUnwindSafe for PlaybackProgress
impl Send for PlaybackProgress
impl Sync for PlaybackProgress
impl Unpin for PlaybackProgress
impl UnsafeUnpin for PlaybackProgress
impl UnwindSafe for PlaybackProgress
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