[−][src]Struct purezen::message::send::Controller
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 receive
ers 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 receive
ers 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]
&mut self,
context: &mut Context<'pd>,
name: &str,
message: &Message<'pd, N>
) where
N: ArrayLength<Atom<'pd>>,
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]
&mut self,
context: &mut Context<'pd>,
outlet_index: Index,
message: &Message<'pd, N>
) where
N: ArrayLength<Atom<'pd>>,
Send a message to the given outlet index
pub fn add_receiver(
&mut self,
receiver: RemoteMessageReceiver
) -> Result<(), Error>
[src]
&mut self,
receiver: RemoteMessageReceiver
) -> Result<(), Error>
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(&self) -> 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]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> Same for T
[src]
type Output = T
Should always be Self