Skip to main content

Source

Trait Source 

Source
pub trait Source: Element {
    // Required method
    fn src_pads(&mut self) -> &mut [SrcPad];
}
Expand description

An element with one or more output ports. It sends data downstream by pushing into its own src_pads() (e.g. self.src_pads()[0].push(buf)) — it’s never handed a downstream argument from the outside. See SrcPad.

Source and Sink are the two halves of the duality: Sink is “has an input”, Source is “has an output”. An element that both receives and produces (a decoder, say) implements both side by side — Sink to receive, Source to push whatever it produces into its own pad(s) from inside consume. There’s no separate “processing element” trait or wrapper needed for that.

Required Methods§

Source

fn src_pads(&mut self) -> &mut [SrcPad]

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§