Skip to main content

Element

Trait Element 

Source
pub trait Element: Send {
    // Required methods
    fn name(&self) -> Arc<str> ;
    fn element_type(&self) -> ElementType;
    fn pp_log(&self) -> &PpLog;
    fn pp_log_mut(&mut self) -> &mut PpLog;

    // Provided method
    fn graph_id(&self) -> Option<ElementId> { ... }
}
Expand description

A node in the pipeline graph with a name. Plain identity only — says nothing about whether the node has an input, an output, both, or neither.

Required Methods§

Source

fn name(&self) -> Arc<str>

Returns a cheap clone (refcount bump, not a deep copy) of this element’s name — crate::bus::BusEvent stores names as Arc<str> for exactly this reason: a hot path like crate::queue::Queue posting BusEvent::Dropped once per overflowed buffer shouldn’t pay for a fresh heap allocation every time it wants to report which element it is.

Source

fn element_type(&self) -> ElementType

Source

fn pp_log(&self) -> &PpLog

This element’s identity for crate::bus::Bus::post — same id/name as Element::name, just already wrapped as the crate::pp_log::PpLog its pp_info!/pp_warn!/pp_error! macros need. A stored private field, not built fresh per call, for the same reason name() returns a cheap Arc<str> clone instead of a fresh String — see its own docs.

Source

fn pp_log_mut(&mut self) -> &mut PpLog

Mutable access to the same field Element::pp_log reads — used by crate::pipeline::ChainBuilder to stamp the owning crate::pipeline::Pipeline’s id onto every element that passes through it, via element_pp_log. Not meant to be called from anywhere else.

Provided Methods§

Source

fn graph_id(&self) -> Option<ElementId>

A pre-reserved graph identity for elements that expose dynamic attachment handles. Most elements receive an ID from ChainBuilder and keep the default None implementation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Element for AppSource

Source§

impl Element for AudioMixer

Source§

impl Element for AudioResampler

Source§

impl Element for AudioVolume

Source§

impl Element for D3d11Decoder

Available on Windows and crate feature d3d11 and (crate features d3d11 or d3d12) only.
Source§

impl Element for D3d11Download

Available on Windows and crate feature d3d11 only.
Source§

impl Element for D3d11NvencEncoder

Available on Windows and crate feature d3d11 only.
Source§

impl Element for D3d11Renderer

Available on Windows and crate feature d3d11 and (crate features d3d11 or d3d12 or wasapi-renderer) only.
Source§

impl Element for D3d11Upload

Available on Windows and crate feature d3d11 and (crate features d3d11 or d3d12) only.
Source§

impl Element for D3d11VideoCompositor

Available on Windows and crate feature d3d11 only.
Source§

impl Element for D3d11VideoCompositorInputSink

Available on Windows and crate feature d3d11 only.
Source§

impl Element for D3d12Renderer

Available on Windows and crate feature d3d12 and (crate features d3d11 or d3d12 or wasapi-renderer) only.
Source§

impl Element for D3d12Upload

Available on Windows and crate feature d3d12 and (crate features d3d11 or d3d12) only.
Source§

impl Element for D3d12vaDecoder

Available on Windows and crate feature d3d12 and (crate features d3d11 or d3d12) only.
Source§

impl Element for DxgiCaptureSource

Available on Windows and crate feature dxgi-capture and (crate features dxgi-capture or wasapi-capture) only.
Source§

impl Element for FileDemuxer

Source§

impl Element for FrameCounter

Source§

impl Element for HlsMuxerStreamSink

Source§

impl Element for MixerInputSink

Source§

impl Element for Mp4MuxerStreamSink

Source§

impl Element for Pacer

Source§

impl Element for PacketCounter

Source§

impl Element for Queue

Source§

impl Element for RtspSink

Source§

impl Element for RtspSource

Source§

impl Element for Scaler

Source§

impl Element for SwAudioEncoder

Source§

impl Element for SwDecoder

Source§

impl Element for SwEncoder

Source§

impl Element for Tee

Source§

impl Element for TestAudioSource

Source§

impl Element for TestVideoSource

Source§

impl Element for VideoCompositor

Source§

impl Element for VideoCompositorInputSink

Source§

impl Element for VideoSynchronizer

Source§

impl Element for WasapiCaptureSource

Available on Windows and crate feature wasapi-capture and (crate features dxgi-capture or wasapi-capture) only.
Source§

impl Element for WasapiRenderer

Available on Windows and crate feature wasapi-renderer and (crate features d3d11 or d3d12 or wasapi-renderer) only.
Source§

impl Element for WebRtcPeer

Available on crate feature webrtc only.
Source§

impl Element for WebRtcTrackSink

Available on crate feature webrtc only.
Source§

impl Element for WebRtcTrackSource

Available on crate feature webrtc only.
Source§

impl<F, C> Element for AppSink<F, C>
where F: FnMut(MediaBuffer) -> Result<()> + Send + 'static, C: FnMut(ControlMsg) -> Result<()> + Send + 'static,

Source§

impl<F> Element for OrtDetector<F>
where F: FnMut(&Video, &[Detection]) -> Result<()> + Send + 'static,

Available on crate feature ort only.