AudioRelation

Struct AudioRelation 

Source
pub struct AudioRelation { /* private fields */ }
Expand description

The directed “who may hear whom” relation, as the flavor declared it.

Accumulated during a render and compiled once at the end. Kept in terms of ConnectionId because that is the vocabulary a flavor thinks in; the translation to SessionId happens at compile time, against the view.

Implementations§

Source§

impl AudioRelation

Source

pub fn domain(&mut self, domain: DomainId, members: &[ConnectionId])

Declare a symmetric group: every member hears every other member.

Repeated calls with the same domain accumulate members rather than replacing them, so a flavor may build a domain across several loops.

Source

pub fn listen(&mut self, listener: ConnectionId, domain: DomainId)

Declare a one-way exception: listener hears the domain, and is not heard by it.

Source

pub fn edge(&mut self, sender: ConnectionId, receiver: ConnectionId)

Declare a single directed edge.

Source

pub fn domains( &self, ) -> impl Iterator<Item = (DomainId, &BTreeSet<ConnectionId>)>

The members of each declared domain.

Source

pub fn listeners( &self, ) -> impl Iterator<Item = (ConnectionId, &BTreeSet<ConnectionId>)>

Each listen declaration, paired with the domain’s members.

A listen on a domain that was never declared yields nothing: failing closed means a typo costs silence rather than a leak.

Source

pub fn listen_declarations( &self, ) -> impl Iterator<Item = (ConnectionId, DomainId)> + '_

Each listen declaration as written, including ones naming a domain that does not exist.

Source

pub fn explicit_edges( &self, ) -> impl Iterator<Item = (ConnectionId, ConnectionId)> + '_

The edges declared one at a time.

Source

pub fn resolve(&self) -> BTreeSet<(ConnectionId, ConnectionId)>

Every directed edge implied by the declarations, as (sender, receiver).

A member never hears itself: the client plays back its own voice locally, and echoing it from the server is the classic doubled-voice bug. The explicit server loopback target is a separate mechanism and is not a route.

This is the definition of the relation, and it materializes every pair - which is quadratic for a full-mesh domain. Nothing on a shard’s turn calls it: compile walks the same structure without a tree, and the render’s own checks walk it by distinct scope. It stays because it says plainly what the relation means, and a test pins compile to it.

Trait Implementations§

Source§

impl Clone for AudioRelation

Source§

fn clone(&self) -> AudioRelation

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AudioRelation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AudioRelation

Source§

fn default() -> AudioRelation

Returns the “default value” for a type. Read more
Source§

impl PartialEq for AudioRelation

Source§

fn eq(&self, other: &AudioRelation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for AudioRelation

Source§

impl StructuralPartialEq for AudioRelation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.