Skip to main content

Follower

Struct Follower 

Source
pub struct Follower { /* private fields */ }
Expand description

One clip’s position, measured on a shared master.

Play, pause, and seek are the clip’s own; the time between them is the master’s. Following a stopped master — an audio device that is paused or gone — freezes the clip where it is, which is the only thing a picture following a sound can sensibly do.

Implementations§

Source§

impl Follower

Source

pub fn new(master: SharedClock) -> Self

Paused, at zero.

Source

pub fn starting_at(master: SharedClock, master_position: Duration) -> Self

Running, with the clip’s zero at master_position on the master — in the past, so the clip is already some way in, or in the future, so it waits. See is_due.

Source

pub fn master(&self) -> &SharedClock

The master this follows.

Source

pub fn play(&mut self)

Starts, or resumes, from wherever the clip is.

Source

pub fn pause(&mut self)

Stops, keeping the position.

Source

pub fn seek(&mut self, position: Duration)

Moves to a position. Keeps running if it was running.

Source

pub fn is_playing(&self) -> bool

Whether the clip itself is playing, whatever the master is doing.

Source

pub fn is_due(&self) -> bool

Whether the clip has reached its start: false only for a clip made with starting_at a point the master has not got to yet.

Trait Implementations§

Source§

impl Clone for Follower

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Follower

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MasterClock for Follower

Source§

fn position(&self) -> Duration

How far into the stream playback currently is.
Source§

fn is_running(&self) -> bool

Whether it is running. A paused master freezes video too.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.