[−][src]Struct purezen::pd::Message
Pure Data messages
Methods
impl<'pd, N> Message<'pd, N> where
N: ArrayLength<Atom<'pd>>,
[src]
N: ArrayLength<Atom<'pd>>,
pub fn from_timestamp(timestamp: Timestamp) -> Self
[src]
Initialize a message with the given timestamp.
This is the primary constructor for all message objects.
pub fn from_string(
timestamp: Timestamp,
init_string: &'pd str
) -> Result<Self, Error>
[src]
timestamp: Timestamp,
init_string: &'pd str
) -> Result<Self, Error>
Adds elements to the message by tokenizing the given string. If a token is numeric then it is
automatically resolved to a float. Otherwise the string is interpreted as a symbol. Note that
the init_string
is tokenized and should be provided in a buffer which may be edited.
pub fn resolve_string<ArgN, BufN>(
init_string: &'pd str,
arguments_opt: Option<&Message<'pd, ArgN>>,
offset: usize,
buffer: &mut String<BufN>
) -> Result<(), Error> where
ArgN: ArrayLength<Atom<'pd>>,
BufN: ArrayLength<u8>,
[src]
init_string: &'pd str,
arguments_opt: Option<&Message<'pd, ArgN>>,
offset: usize,
buffer: &mut String<BufN>
) -> Result<(), Error> where
ArgN: ArrayLength<Atom<'pd>>,
BufN: ArrayLength<u8>,
Resolve arguments in a string with a given argument list into the given buffer
.
The offset
parameter adjusts the resolution of the $
argument.
In the case of message boxes, $0
refers to the graph id, which is the first argument in a
graph's list of arguments. For all other objects, $1
refers to the first (0th) element of
the argument. The offset is used to distinguish between these
cases, by offsetting the argument index resolution.
pub fn resolve_symbols_to_type(&mut self)
[src]
Converts symbolic elements referring to message element types (e.g. float
or f
) to those
types. For instance, if an element has a symbolic value of float
, then that element is
converted into one of type FLOAT
.
pub fn get_num_elements(&self) -> usize
[src]
Get the number of elements in this message
pub fn get_element(&self, index: usize) -> Option<&Atom>
[src]
Get the element at the particular lindex
pub fn atom_is_equal_to(&self, index: usize, other: &Atom) -> bool
[src]
Is the atom at the given index equal to the other atom?
pub fn set_timestamp(&mut self, timestamp: Timestamp)
[src]
Set the global timestamp of this message (in milliseconds)
pub fn get_timestamp(&self) -> Timestamp
[src]
Get the global timestamp of this message (in milliseconds)
pub fn is_float(&self, index: usize) -> bool
[src]
Is the given message element a float?
pub fn is_symbol(&self, index: usize) -> bool
[src]
Is the given message element a symbol?
pub fn is_symbol_str(&self, index: usize, test: &str) -> bool
[src]
Is the given message element a symbol that matches the given test string?
pub fn is_bang(&self, index: usize) -> bool
[src]
Is the given message element a bang?
pub fn has_format(&self, format: &str) -> bool
[src]
Does this message match the given format string
pub fn get_type(&self, index: usize) -> Type
[src]
Get the type for the given message
pub fn get_float(&self, index: usize) -> Option<f32>
[src]
Convenience function to get the float value from a particular message element
pub fn get_symbol(&self, index: usize) -> Option<&str>
[src]
Get the symbol value for the given element
pub fn set_element(
&mut self,
index: usize,
value: Atom<'pd>
) -> Result<(), Error>
[src]
&mut self,
index: usize,
value: Atom<'pd>
) -> Result<(), Error>
Set an element to the given atom value
Panics if the index exceeds the capacity of the buffer
pub fn set_anything(&mut self, index: usize) -> Result<(), Error>
[src]
Convenience function to set a message element to the ANYTHING
atom
Panics if there isn't enough space in the atoms buffer.
pub fn set_bang(&mut self, index: usize) -> Result<(), Error>
[src]
Convenience function to set a message element to the BANG
atom
Panics if there isn't enough space in the atoms buffer.
pub fn set_float(&mut self, index: usize, value: f32) -> Result<(), Error>
[src]
Convenience function to set a message element to a float value.
Panics if there isn't enough space in the atoms buffer.
pub fn set_list(&mut self, index: usize) -> Result<(), Error>
[src]
Convenience function to set a message element to the LIST
atom
Panics if there isn't enough space in the atoms buffer.
pub fn set_symbol(
&mut self,
index: usize,
symbol: &'pd str
) -> Result<(), Error>
[src]
&mut self,
index: usize,
symbol: &'pd str
) -> Result<(), Error>
Convenience function to set a message element to a symbol value.
Panics if there isn't enough space in the atoms buffer.
pub fn clone_on_heap(&self)
[src]
Legacy function which copies messages to the heap
impl<'pd> Message<'pd, U1>
[src]
pub fn from_timestamp_and_atom(timestamp: Timestamp, atom: Atom<'pd>) -> Self
[src]
Initialize a message with a timestamp and Atom
pub fn from_timestamp_and_bang(timestamp: Timestamp) -> Self
[src]
Initialize a message with a timestamp and a "bang"
pub fn from_timestamp_and_float(timestamp: Timestamp, value: f32) -> Self
[src]
Initialize a message with a timestamp and a floating point value
pub fn from_timestamp_and_symbol(timestamp: Timestamp, symbol: &'pd str) -> Self
[src]
Innitialize a message with a timestamp and the given "symbol"
Trait Implementations
impl<'pd, N: Clone + ArrayLength<Atom<'pd>>> Clone for Message<'pd, N>
[src]
fn clone(&self) -> Message<'pd, N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'pd, N> PartialEq<Message<'pd, N>> for Message<'pd, N> where
N: ArrayLength<Atom<'pd>>,
[src]
N: ArrayLength<Atom<'pd>>,
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'pd, N> Display for Message<'pd, N> where
N: ArrayLength<Atom<'pd>>,
[src]
N: ArrayLength<Atom<'pd>>,
impl<'pd, N: Debug + ArrayLength<Atom<'pd>>> Debug for Message<'pd, N>
[src]
impl<'pd, N> Index<usize> for Message<'pd, N> where
N: ArrayLength<Atom<'pd>>,
[src]
N: ArrayLength<Atom<'pd>>,
type Output = Atom<'pd>
The returned type after indexing.
fn index(&self, index: usize) -> &Atom<'pd>
[src]
impl<'pd, N> IndexMut<usize> for Message<'pd, N> where
N: ArrayLength<Atom<'pd>>,
[src]
N: ArrayLength<Atom<'pd>>,
Auto Trait Implementations
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> Same for T
[src]
type Output = T
Should always be Self