VoiceEvent

Enum VoiceEvent 

Source
#[non_exhaustive]
pub enum VoiceEvent { Connected { connection: ConnectionId, }, Disconnected { connection: ConnectionId, reason: String, }, Migrated { connection: ConnectionId, to: ShardId, }, RequestedChannel { connection: ConnectionId, channel: ChannelKey, }, RequestedSelfState { connection: ConnectionId, self_mute: Option<bool>, self_deaf: Option<bool>, }, InvokedAction { connection: ConnectionId, action: ActionKey, on: ActionTarget, }, Said { connection: ConnectionId, to: Audience, text: String, }, }
Expand description

A voice-plane fact reported to the flavor.

Always a statement about the runtime, never a command: the flavor alone decides what its state becomes, and ignoring an event is a valid answer.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Connected

A connection was attached to this shard.

Fields

§connection: ConnectionId
§

Disconnected

A connection is gone. No further event will carry it.

Fields

§connection: ConnectionId
§reason: String
§

Migrated

A connection left for another shard. Its socket is still alive and its session is unchanged; only this shard stops describing it.

Distinct from VoiceEvent::Disconnected because the two mean opposite things to a flavor: a disconnect frees a slot, a migration hands it over.

Fields

§connection: ConnectionId
§

RequestedChannel

The client asked to enter a channel, by double-clicking it or dragging itself into it.

A request, never a fact: the channel is one this connection can actually see, and nothing has moved. What it means is entirely the flavor’s business, up to and including ignoring it.

REF: references/vendored/Mumble.proto : UserState.channel_id sent by a client for its own session.

Fields

§connection: ConnectionId
§channel: ChannelKey
§

RequestedSelfState

The client asked to mute or deafen itself.

A request like the others: the flags a client sees are the ones the flavor renders, so refusing is simply rendering nothing new. A flavor that grants it stores the pair and hands it back through crate::build::ShardBuilder::user_flags.

None means the client said nothing about that flag, so whatever the flavor currently renders stands. The runtime holds no copy of the pair: that state belongs to the flavor, and keeping a second one here is how the two start disagreeing.

REF: references/mumble/src/mumble/ServerHandler.cpp : setSelfMuteDeafState sends a UserState carrying both flags.

Fields

§connection: ConnectionId
§self_mute: Option<bool>
§self_deaf: Option<bool>
§

InvokedAction

The client invoked a context action this shard had offered it.

Everything is already resolved against what that connection was actually granted and can actually see: the key was offered to it, the target is visible to it, and the place matches the bits the flavor declared. What the action means is the flavor’s business alone, including doing nothing and refusing through crate::reply::Reply::refuse.

REF: references/mumble/src/mumble/MainWindow.cpp : context_triggered sends back the identifier the server stored, with the selected user and channel.

Fields

§connection: ConnectionId
§action: ActionKey
§

Said

The client typed something and aimed it somewhere.

A request like every other: the target is already resolved against what this connection can see, and the channel it names is one the flavor rendered as writable, but nothing has been delivered. A flavor that ignores this event delivers nothing, which is the honest default for a runtime whose whole subject is who may know what.

crate::reply::Reply::relay is the one line that carries it out, and the flavor is free to rewrite the audience, the text, or both.

REF: references/mumble/src/murmur/Messages.cpp : msgTextMessage resolves the targets against the sender’s view, then routes.

Fields

§connection: ConnectionId
§text: String

Trait Implementations§

Source§

impl Clone for VoiceEvent

Source§

fn clone(&self) -> VoiceEvent

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 VoiceEvent

Source§

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

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

impl PartialEq for VoiceEvent

Source§

fn eq(&self, other: &VoiceEvent) -> 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 VoiceEvent

Source§

impl StructuralPartialEq for VoiceEvent

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.