pub struct OscMessage {
pub address: String,
pub arguments: Vec<OscArgument>,
}Expand description
Represents an OSC message
Fields§
§address: String§arguments: Vec<OscArgument>Implementations§
Source§impl OscMessage
impl OscMessage
Sourcepub fn new(address: impl Into<String>) -> Self
pub fn new(address: impl Into<String>) -> Self
Constructs a new OscMessage with a given address and zero arguments
Sourcepub fn with_arg(self, arg: OscArgument) -> Self
pub fn with_arg(self, arg: OscArgument) -> Self
Adds an argument to the OscMessage and returns the modified message
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, OscParseError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, OscParseError>
Construct an OscMessage from a sequence of bytes
Sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Construct an OscMessage from a sequence of bytes
Examples found in repository?
examples/receive_messages.rs (line 10)
4fn main() {
5 let listen_port = 9000;
6 let receiver = OscReceiver::new(listen_port).unwrap();
7
8 loop {
9 match receiver.get_messages() {
10 Ok(OscPacket::Message(msg)) => println!("Got message: {}", msg.to_string()),
11 Ok(OscPacket::Bundle(bundle)) => println!("Got bundle: {:?}", bundle.time_tag.seconds),
12 Err(err) => eprintln!("Parse error: {:?}", err),
13 }
14 }
15}Auto Trait Implementations§
impl Freeze for OscMessage
impl RefUnwindSafe for OscMessage
impl Send for OscMessage
impl Sync for OscMessage
impl Unpin for OscMessage
impl UnwindSafe for OscMessage
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