pub trait Driver: Element {
// Required method
fn run(&mut self, stop: &StopReceiver, bus: &Bus) -> Result<()>;
}Expand description
A background task with no Sink/Source ports of its own — nothing to
push into, nothing to pull out of this object; whatever it produces
or consumes happens through other Sink/Source pairs it mints on the
side (e.g. WebRtcPeer handing out
WebRtcTrackSink/WebRtcTrackSource). Reach for
crate::pipeline::Pipeline/crate::element::SourceElement instead
for anything that actually has a src_pads() dataflow graph to wire —
Driver deliberately has no Pause/Seek/Clock, none of which have
a sensible meaning for a connection that isn’t part of one.
Required Methods§
Sourcefn run(&mut self, stop: &StopReceiver, bus: &Bus) -> Result<()>
fn run(&mut self, stop: &StopReceiver, bus: &Bus) -> Result<()>
Drives this task until it ends on its own or stop.is_stopped()
says to abandon — check it periodically, the same spirit as
crate::control::drain_control for a
crate::element::SourceElement. bus is this task’s own way to
report a failure without necessarily ending itself over it — see
crate::element::SourceElement::run’s docs for the same
convention.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Driver for WebRtcPeer
webrtc only.