Skip to main content

BoxedNodeSend

Struct BoxedNodeSend 

Source
pub struct BoxedNodeSend(pub Box<dyn Node + Send>);
Expand description

A wrapper around a Box<dyn Node>.

Provides the necessary Sized implementation to allow for compatibility with the graph process function.

Useful when the ability to send nodes from one thread to another is required. E.g. this is common when initialising nodes or the audio graph itself on one thread before sending them to the audio thread.

Tuple Fields§

§0: Box<dyn Node + Send>

Implementations§

Source§

impl BoxedNodeSend

Source

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

Create a new BoxedNode around the given node.

This is short-hand for BoxedNode::from(Box::new(node)).

Trait Implementations§

Source§

impl Debug for BoxedNodeSend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for BoxedNodeSend

Source§

type Target = Box<dyn Node + Send>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for BoxedNodeSend

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T> From<Box<T>> for BoxedNodeSend
where T: 'static + Node + Send,

Source§

fn from(n: Box<T>) -> Self

Converts to this type from the input type.
Source§

impl Into<Box<dyn Node + Send>> for BoxedNodeSend

Source§

fn into(self) -> Box<dyn Node + Send>

Converts this type into the (usually inferred) input type.
Source§

impl Node for BoxedNodeSend

Source§

fn process(&mut self, inputs: &[Input], output: &mut [Buffer])

Process some audio given a list of the node’s inputs and write the result to the output buffers. Read more

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<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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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>,

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

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