pub struct InReader<'a, 'c> { /* private fields */ }Expand description
Field reader used by node factories: classifies each field as
literal / $param / @node and accumulates the node’s scalar
port plumbing. See the module docs for the usage pattern.
Implementations§
Source§impl<'a, 'c> InReader<'a, 'c>
impl<'a, 'c> InReader<'a, 'c>
Sourcepub fn new(
fields: &'a Map<String, Value>,
ctx: &'a FactoryCtx<'c>,
fixed_ports: usize,
) -> Self
pub fn new( fields: &'a Map<String, Value>, ctx: &'a FactoryCtx<'c>, fixed_ports: usize, ) -> Self
fixed_ports is the number of input ports the node declares
before any scalar ports (e.g. 1 for blur’s input). Scalar
port indices start there.
Sourcepub fn number(&mut self, name: &'static str) -> Result<In<f64>, FactoryError>
pub fn number(&mut self, name: &'static str) -> Result<In<f64>, FactoryError>
Required number field.
Sourcepub fn number_or(
&mut self,
name: &'static str,
default: f64,
) -> Result<In<f64>, FactoryError>
pub fn number_or( &mut self, name: &'static str, default: f64, ) -> Result<In<f64>, FactoryError>
Optional number field with a default.
Sourcepub fn color(
&mut self,
name: &'static str,
) -> Result<In<[f32; 4]>, FactoryError>
pub fn color( &mut self, name: &'static str, ) -> Result<In<[f32; 4]>, FactoryError>
Required color field (#rrggbb[aa], $param, or @node).
Sourcepub fn color_or(
&mut self,
name: &'static str,
default: [f32; 4],
) -> Result<In<[f32; 4]>, FactoryError>
pub fn color_or( &mut self, name: &'static str, default: [f32; 4], ) -> Result<In<[f32; 4]>, FactoryError>
Optional color field with a default.
Sourcepub fn color_opt(
&mut self,
name: &'static str,
) -> Result<Option<In<[f32; 4]>>, FactoryError>
pub fn color_opt( &mut self, name: &'static str, ) -> Result<Option<In<[f32; 4]>>, FactoryError>
Optional color field; None when absent.
Auto Trait Implementations§
impl<'a, 'c> Freeze for InReader<'a, 'c>
impl<'a, 'c> RefUnwindSafe for InReader<'a, 'c>
impl<'a, 'c> Send for InReader<'a, 'c>
impl<'a, 'c> Sync for InReader<'a, 'c>
impl<'a, 'c> Unpin for InReader<'a, 'c>
impl<'a, 'c> UnsafeUnpin for InReader<'a, 'c>
impl<'a, 'c> UnwindSafe for InReader<'a, 'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more