Skip to main content

MultiInputNode

Struct MultiInputNode 

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

A node with a configurable number of inputs and outputs.

Used for fan-in topologies where multiple upstream outputs are combined.

Implementations§

Source§

impl MultiInputNode

Source

pub fn new(inputs: u32, outputs: u32, name: impl Into<String>) -> Self

Create a new multi-input node.

All ports are typed as Any (video or audio).

Source

pub fn with_id(self, id: NodeId) -> Self

Set the node ID.

Source

pub fn input_count(&self) -> usize

Return the number of input ports.

Source

pub fn output_count(&self) -> usize

Return the number of output ports.

Trait Implementations§

Source§

impl Node for MultiInputNode

Source§

fn id(&self) -> NodeId

Get the node’s unique identifier.
Source§

fn name(&self) -> &str

Get the node’s name.
Source§

fn node_type(&self) -> NodeType

Get the node type.
Source§

fn state(&self) -> NodeState

Get the current state of the node.
Source§

fn set_state(&mut self, state: NodeState) -> GraphResult<()>

Set the node state.
Source§

fn inputs(&self) -> &[InputPort]

Get the node’s input ports.
Source§

fn outputs(&self) -> &[OutputPort]

Get the node’s output ports.
Source§

fn process( &mut self, input: Option<FilterFrame>, ) -> GraphResult<Option<FilterFrame>>

Process available input and produce output. Read more
Source§

fn reset(&mut self) -> GraphResult<()>

Reset the node to initial state.
Source§

fn initialize(&mut self) -> GraphResult<()>

Initialize the node before processing starts.
Source§

fn flush(&mut self) -> GraphResult<Vec<FilterFrame>>

Flush any buffered data.
Source§

fn input_port(&self, id: PortId) -> Option<&InputPort>

Get input port by ID.
Source§

fn output_port(&self, id: PortId) -> Option<&OutputPort>

Get output port by ID.
Source§

fn accepts_input(&self, port_type: PortType) -> bool

Check if node accepts the given port type as input.
Source§

fn produces_output(&self, port_type: PortType) -> bool

Check if node produces the given port type as output.

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.