Skip to main content

ControlMsg

Enum ControlMsg 

Source
pub enum ControlMsg {
    Pause,
    Resume,
    Stop,
    Seek(Duration),
}
Expand description

A command that can be sent down a running crate::pipeline::Pipeline — travels the same pad-to-pad path MediaBuffer does (see crate::element::Sink::control), but through a dedicated channel instead of riding along as data: unlike Eos, it has to be able to reach every element even mid-stream, and (for Queue) jump ahead of whatever data is already backed up rather than wait in line behind it.

Variants§

§

Pause

Freeze in place. Every crate::queue::Queue downstream stops pulling from its data channel until Resume/Stop — which also backpressures anything feeding it, since a full queue blocks the sender. Pairs with crate::clock::Clock::pause, which crate::pipeline::Pipeline::pause calls at the same time so paced elements don’t see a jump once resumed.

§

Resume

Undoes Pause.

§

Stop

Abandon immediately rather than draining to a natural Eos — whatever’s in flight is dropped, not flushed. The pipeline isn’t reusable afterward; build a new one for the next run.

§

Seek(Duration)

Jump to an absolute position from the start of the media. Handled in two parts, both inside drain_control: the source itself repositions via crate::element::SourceElement::seek before this is forwarded downstream, then the forward cascades as usual — a crate::queue::Queue drops whatever it has buffered (it predates the seek) instead of delivering it, and a decoder flushes its internal reference-frame state. Unlike Pause, this doesn’t block waiting for anything further: it’s a one-shot repositioning, not a state to later undo with Resume.

Trait Implementations§

Source§

impl Clone for ControlMsg

Source§

fn clone(&self) -> ControlMsg

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 Copy for ControlMsg

Source§

impl Debug for ControlMsg

Source§

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

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

impl Eq for ControlMsg

Source§

impl PartialEq for ControlMsg

Source§

fn eq(&self, other: &ControlMsg) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ControlMsg

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
§

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

§

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
§

impl<T> CryptoSafe for T
where T: Send + Sync + Debug,

§

impl<T> CryptoSafe for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more