pub enum IrValue {
Null,
Bool(bool),
Integer(i64),
Float(f64),
String(Box<str>),
Binary(Vec<u8>),
Array(Vec<IrValue>),
Map(Vec<(String, IrValue)>),
Timestamp(IrTimestamp),
Ext {
type_id: i8,
data: Vec<u8>,
},
Bundle(IrBundle),
}Expand description
Protocol-agnostic value space.
Variants§
Null
Bool(bool)
Integer(i64)
Float(f64)
String(Box<str>)
Binary(Vec<u8>)
Array(Vec<IrValue>)
Map(Vec<(String, IrValue)>)
Map keys are Strings for JSON compatibility.
Timestamp(IrTimestamp)
Ext
MessagePack Ext type compatibility; also useful to carry OSC-specific tags.
Bundle(IrBundle)
OSC Bundle with timetag and nested elements Available with OSC 1.0+ support.
Implementations§
Source§impl IrValue
impl IrValue
pub fn null() -> Self
pub fn is_null(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn as_integer(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_str(&self) -> Option<&str>
pub fn as_binary(&self) -> Option<&[u8]>
pub fn as_array(&self) -> Option<&[IrValue]>
pub fn as_map(&self) -> Option<&[(String, IrValue)]>
pub fn as_timestamp(&self) -> Option<&IrTimestamp>
pub fn as_ext(&self) -> Option<(i8, &[u8])>
pub fn as_bundle(&self) -> Option<&IrBundle>
Trait Implementations§
Source§impl From<IrTimestamp> for IrValue
impl From<IrTimestamp> for IrValue
Source§fn from(v: IrTimestamp) -> Self
fn from(v: IrTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<IrValue> for IrBundleElement
Available on crate feature osc10 only.
impl From<IrValue> for IrBundleElement
Available on crate feature
osc10 only.impl StructuralPartialEq for IrValue
Auto Trait Implementations§
impl Freeze for IrValue
impl RefUnwindSafe for IrValue
impl Send for IrValue
impl Sync for IrValue
impl Unpin for IrValue
impl UnwindSafe for IrValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more