pub struct AudioRouting { /* private fields */ }Expand description
The compiled table the voice plane reads.
Replaced whole, never mutated in place: the voice plane loads it without a lock, and mutating it would put a lock on the audio path.
The transport half of the guide’s Delivery - the live UDP address, the OCB2
state, the output queue - is deliberately absent. Binding sessions to live
transports is the voice plane’s job (guide 9.7, build step 8); what a shard
owes it is who may hear whom, and from which version.
Implementations§
Source§impl AudioRouting
impl AudioRouting
Sourcepub fn receivers(&self, sender: SessionId) -> &[SessionId]
pub fn receivers(&self, sender: SessionId) -> &[SessionId]
The sessions that may hear sender, or an empty slice.
Sourcepub fn since(&self, session: SessionId) -> Option<u64>
pub fn since(&self, session: SessionId) -> Option<u64>
The shard version at which session became visible.
The voice plane gates on this: a receiver whose cursor has not reached
the sender’s since does not get the packet, because it has not been
told the sender exists yet and would discard the audio anyway.
It is per participant rather than per pair, which is what keeps the table O(N) instead of O(N squared).
Sourcepub fn may_hear(&self, sender: SessionId, receiver: SessionId) -> bool
pub fn may_hear(&self, sender: SessionId, receiver: SessionId) -> bool
Whether receiver may hear sender at all, ignoring the cursor gate.
Sourcepub fn may_speak(&self, sender: SessionId) -> bool
pub fn may_speak(&self, sender: SessionId) -> bool
Whether this session’s voice may leave the server at all.
Every route already answers it - a muted sender has no receivers - so this exists for the one delivery that goes through no route: the server loopback. A muted microphone that still echoes back would tell its owner the line is open when nobody else can hear a thing.
Trait Implementations§
Source§impl Clone for AudioRouting
impl Clone for AudioRouting
Source§fn clone(&self) -> AudioRouting
fn clone(&self) -> AudioRouting
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more