[][src]Struct purezen::message::send::Controller

pub struct Controller { /* fields omitted */ }

Message send controller object.

Because of features such as external message injection and implicit message sending from message boxes, it must be possible to send a message to associated receiveers without explicitly requiring a send object to exist in the graph. The message::send::Controller is intended as a central dispatcher for all sent messages, delivering a message to all associated receiveers without requiring the existence of a send object.

It can deliver messages via the usual receive_message() function, where the inlet index identifies a receiver name. The index for a receiver name can be determined with get_name_index(). This is useful for messages that must be scheduled in the global message queue and must then be dispatched via the receive_message() function.

Alternatively, a message can be sent to receivers using receive_message() with name and message arguments (instead of inlet index and message). Messages sent using this alternative will be sent right away (avoiding the message queue).

Methods

impl Controller[src]

pub fn new() -> Self[src]

Create a new message::send::Controller

pub fn receiver_exists(&self, receiver_name: &str) -> bool[src]

Returns true if a receiver by that name is already registered, or false otherwise.

pub fn get_name_index(&self, receiver_name: &str) -> Option<Index>[src]

Returns the index to which the given receiver name is referenced. Used with receive_message(usize, &pd::Message<_>).

pub fn receive_message<'pd, N>(
    &mut self,
    context: &mut Context<'pd>,
    name: &str,
    message: &Message<'pd, N>
) where
    N: ArrayLength<Atom<'pd>>, 
[src]

Sends the message on to all receivers with the given name

pub fn send_message<'pd, N>(
    &mut self,
    context: &mut Context<'pd>,
    outlet_index: Index,
    message: &Message<'pd, N>
) where
    N: ArrayLength<Atom<'pd>>, 
[src]

Send a message to the given outlet index

pub fn add_receiver(
    &mut self,
    receiver: RemoteMessageReceiver
) -> Result<(), Error>
[src]

Add a receiver to this send controller

pub fn remove_receiver(&mut self, receiver: RemoteMessageReceiver)[src]

Remove a receiver from this send controller

pub fn register_external_receiver(&mut self, receiver_name: &str)[src]

Register an external message receiver with this send controller

pub fn unregister_external_receiver(&mut self, _receiver_name: &str)[src]

Unregister an external message receiver from this send controller

Trait Implementations

impl Clone for Controller[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Controller[src]

impl Default for Controller[src]

Auto Trait Implementations

impl Send for Controller

impl Sync for Controller

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> Same for T[src]

type Output = T

Should always be Self