#[repr(C)]pub struct NetMessage {
pub message_type: NetMessageType,
pub param_hash: u32,
pub payload: NetPayload,
pub node_id: NodeId,
pub timestamp: SyncedTimestamp,
}Expand description
A network message for audio control.
Uses #[repr(C)] for FFI compatibility.
Fields§
§message_type: NetMessageTypeThe type of message.
param_hash: u32Target parameter name hash (FNV-1a for fast lookup).
payload: NetPayloadMessage payload data.
node_id: NodeIdSource node identifier.
timestamp: SyncedTimestampScheduled timestamp (synced clock).
Implementations§
Source§impl NetMessage
impl NetMessage
Sourcepub fn param_change(param_name: &str, value: f32, node_id: NodeId) -> Self
pub fn param_change(param_name: &str, value: f32, node_id: NodeId) -> Self
Create a new parameter change message.
Sourcepub fn trigger_with_coordinates(
trigger_name: &str,
x: f32,
y: f32,
node_id: NodeId,
) -> Self
pub fn trigger_with_coordinates( trigger_name: &str, x: f32, y: f32, node_id: NodeId, ) -> Self
Create a trigger with 2D coordinates.
Sourcepub fn ping(node_id: NodeId, timestamp: SyncedTimestamp) -> Self
pub fn ping(node_id: NodeId, timestamp: SyncedTimestamp) -> Self
Create a ping message for latency measurement.
Sourcepub fn pong(node_id: NodeId, timestamp: SyncedTimestamp) -> Self
pub fn pong(node_id: NodeId, timestamp: SyncedTimestamp) -> Self
Create a pong response message.
Sourcepub fn with_timestamp(self, timestamp: SyncedTimestamp) -> Self
pub fn with_timestamp(self, timestamp: SyncedTimestamp) -> Self
Set the timestamp for scheduled delivery.
Trait Implementations§
Source§impl Clone for NetMessage
impl Clone for NetMessage
Source§fn clone(&self) -> NetMessage
fn clone(&self) -> NetMessage
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 NetMessage
impl Debug for NetMessage
impl Copy for NetMessage
Auto Trait Implementations§
impl Freeze for NetMessage
impl RefUnwindSafe for NetMessage
impl Send for NetMessage
impl Sync for NetMessage
impl Unpin for NetMessage
impl UnwindSafe for NetMessage
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