Struct glicol_synth::NodeData

source ·
pub struct NodeData<T: ?Sized, const N: usize> {
    pub buffers: Vec<Buffer<N>>,
    pub node: T,
}
Expand description

For use as the node weight within a dasp graph. Contains the node and its buffers.

For a graph to be compatible with a graph Processor, its node weights must be of type NodeData<T>, where T is some type that implements the Node trait.

Fields§

§buffers: Vec<Buffer<N>>§node: T

Implementations§

source§

impl<T, const N: usize> NodeData<T, N>

source

pub fn new(node: T, buffers: Vec<Buffer<N>>) -> Self

Construct a new NodeData from an instance of its node type and buffers.

source

pub fn new1(node: T) -> Self

Creates a new NodeData with a single buffer.

source

pub fn new2(node: T) -> Self

Creates a new NodeData with two buffers.

source

pub fn multi_chan_node(chan: usize, node: T) -> Self

Creates a new NodeData with 8 buffers.

source§

impl<const N: usize> NodeData<BoxedNode<N>, N>

source

pub fn boxed<T>(node: T, buffers: Vec<Buffer<N>>) -> Self
where T: 'static + Node<N>,

The same as new, but boxes the given node data before storing it.

source

pub fn boxed1<T>(node: T) -> Self
where T: 'static + Node<N>,

The same as new1, but boxes the given node data before storing it.

source

pub fn boxed2<T>(node: T) -> Self
where T: 'static + Node<N>,

The same as new2, but boxes the given node data before storing it.

Auto Trait Implementations§

§

impl<T, const N: usize> Freeze for NodeData<T, N>
where T: Freeze + ?Sized,

§

impl<T, const N: usize> RefUnwindSafe for NodeData<T, N>
where T: RefUnwindSafe + ?Sized,

§

impl<T, const N: usize> Send for NodeData<T, N>
where T: Send + ?Sized,

§

impl<T, const N: usize> Sync for NodeData<T, N>
where T: Sync + ?Sized,

§

impl<T, const N: usize> Unpin for NodeData<T, N>
where T: Unpin + ?Sized,

§

impl<T, const N: usize> UnwindSafe for NodeData<T, N>
where T: UnwindSafe + ?Sized,

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<S> FromSample<S> for S

source§

fn from_sample_(s: S) -> S

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, U> ToSample<U> for T
where U: FromSample<T>,

source§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,