pub struct OscTimeTag {
pub seconds: u32,
pub fractional: u32,
}Expand description
Represents an OSC Time Tag
Fields§
§seconds: u32§fractional: u32Implementations§
Source§impl OscTimeTag
impl OscTimeTag
Sourcepub fn now() -> Self
pub fn now() -> Self
Constructs an OscTimeTag representing the current time
Examples found in repository?
examples/send_message.rs (line 39)
3fn main() {
4 let sender = OscSender::new("127.0.0.1".to_string(), 9000);
5
6 //--------------------------------------------------------------
7 // Send an OSC Message
8
9 let m1 = OscMessage {
10 address: String::from("/hello"),
11 arguments: vec![
12 OscArgument::Int32(123),
13 OscArgument::String("abc".to_string())
14 ]
15 };
16
17 sender.send_message (&m1);
18
19
20 //--------------------------------------------------------------
21 // Send an OSC Bundle
22
23 let m2 = OscMessage {
24 address: String::from("/frequency"),
25 arguments: vec![
26 OscArgument::Float32(440.0),
27 ]
28 };
29
30 let m3 = OscMessage {
31 address: String::from("/instrument"),
32 arguments: vec![
33 OscArgument::String("drums".to_string()),
34 OscArgument::Int32(4)
35 ]
36 };
37
38 let b1 = OscBundle {
39 time_tag: OscTimeTag::now(),
40 messages: vec![m2, m3]
41 };
42
43 sender.send_bundle (&b1);
44}Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, OscParseError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, OscParseError>
Constructs an OscTimeTag from a sequence of bytes
Trait Implementations§
Source§impl Clone for OscTimeTag
impl Clone for OscTimeTag
Source§fn clone(&self) -> OscTimeTag
fn clone(&self) -> OscTimeTag
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OscTimeTag
impl Debug for OscTimeTag
Source§impl PartialEq for OscTimeTag
impl PartialEq for OscTimeTag
impl StructuralPartialEq for OscTimeTag
Auto Trait Implementations§
impl Freeze for OscTimeTag
impl RefUnwindSafe for OscTimeTag
impl Send for OscTimeTag
impl Sync for OscTimeTag
impl Unpin for OscTimeTag
impl UnwindSafe for OscTimeTag
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