Skip to main content

DriverRunner

Struct DriverRunner 

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

Runs a Driver on its own background thread — the Driver analog of crate::pipeline::Pipeline, minus everything that only makes sense for a dataflow graph (Clock, Pause, Seek, the wire callback).

run() is asynchronous, same as Pipeline::run: it starts the driver on a background thread and returns immediately. Watch DriverRunner::bus to learn when it’s actually done — draining it blocks until every Bus sender has been dropped. The built-in drivers keep that sender only for the duration of their background run call, so this normally coincides with thread completion; a custom Driver that clones and retains bus extends the wait until its clone drops.

Implementations§

Source§

impl DriverRunner

Source

pub fn new(driver: impl Driver + 'static) -> Arc<Self>

Source

pub fn bus(&self) -> &BusReceiver

Source

pub fn run(self: &Arc<Self>)

Starts driving the task on a background thread and returns immediately. A no-op if this DriverRunner is already running or has already finished a previous run — same posture as crate::pipeline::Pipeline::run, not reusable afterward.

Source

pub fn stop(&self)

Requests an early stop — see StopReceiver’s own docs for why this never blocks. A no-op if run() isn’t currently in progress.

Trait Implementations§

Source§

impl Drop for DriverRunner

Source§

fn drop(&mut self)

Same posture as crate::pipeline::Pipeline’s own Drop: dropping the last handle stops the background work instead of leaking it. Sets the flag directly rather than through stop() — by the time this runs there’s no Arc<Self> left to reach &self through one, only the raw fields still being torn down.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> 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, 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