#[non_exhaustive]pub enum Signal {
Show 19 variants
Join {
channel: String,
},
Leave {
channel: String,
},
Joined {
members: Vec<String>,
mode: Option<RoomKind>,
role: Option<Role>,
streamers: Option<Vec<String>>,
turn: Option<TurnCredentials>,
tracks: Option<Vec<TrackHint>>,
},
Offer {
sdp: String,
tracks: Option<Vec<TrackHint>>,
chunk: Option<ChunkMeta>,
},
Answer {
sdp: String,
chunk: Option<ChunkMeta>,
},
Ice {
cand: String,
mid: Option<String>,
mlineidx: Option<u32>,
},
Presence {
member: String,
state: PresenceState,
kind: Option<ToggleKind>,
role: Option<Role>,
},
Mic {
state: OnOff,
},
Video {
state: OnOff,
},
Screen {
state: OnOff,
},
Hand {
state: OnOff,
},
Deaf {
state: OnOff,
},
Speaking,
Silent,
React {
member: Option<String>,
emoji: String,
},
Promote {
target: String,
},
Demote {
target: String,
},
Role {
member: String,
role: Role,
},
Error {
error: Option<String>,
},
}Expand description
One +obsidianirc/rtc signalling frame.
Every variant is one JSON object’s type. The published
https://github.com/obbyworld/extensions/blob/main/voice.md documents only 9 of these, the
wire carries 19, and this enum follows the wire. Outbound intent and inbound notification are modelled as distinct shapes where the
wire actually distinguishes them (mic/video/screen/hand/speaking/silent/deaf
versus the presence they get rebroadcast as; promote/demote versus role), rather than
collapsed into one type as the published table’s prose implies.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Join
Ask to join a voice room. Client to server.
Leave
Leave a voice room. Client to server.
A reconnect should send this before rejoining: a dropped link otherwise leaves the SFU
holding a dead peer for this nick, which answers a plain join with “already joined”
rather than a fresh handshake.
Joined
The server admitted us to the room. Server to client.
Fields
turn: Option<TurnCredentials>The TURN credentials for this call.
Offer
An SDP offer, from either side: ours to the SFU, or the SFU renegotiating with us.
Fields
Answer
An SDP answer, from either side.
Fields
Ice
One ICE candidate, from either side.
Fields
Presence
A room or participant state change. Server to client only.
Fields
state: PresenceStateWhat changed.
kind: Option<ToggleKind>Which toggle, when state is PresenceState::On or PresenceState::Off.
role: Option<Role>The role granted, when state is PresenceState::Joined in a $ room.
Mic
Our microphone toggled. Client to server; the server rebroadcasts it as presence.
Video
Our camera toggled.
Screen
Our screen share toggled.
Hand
Our raised hand toggled.
Deaf
Our deafen toggled.
A room learns that someone deafened only from this frame, so we send it the way we send
mic, video, screen and hand, and the room applies the matching presence
deaf-on/deaf-off like every other toggle.
Speaking
Our own voice-activity detector says we started talking.
Silent
Our own voice-activity detector says we stopped talking.
React
React with an emoji. Outbound carries no member (the sender is implicit); the server’s
rebroadcast adds it.
Fields
Promote
Ask to promote target to publisher, in a $ room. Client to server.
Only the room’s first streamer may do this, and self-demotion is always allowed, but that rule is enforced only by the server: nothing stops a client from sending this frame regardless.
Demote
Ask to demote target back to viewer, in a $ room. Client to server.
Role
The server’s authoritative answer to a promote or demote. Server to client.
Error
The server rejected the last request.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signal
impl<'de> Deserialize<'de> for Signal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Signal
impl StructuralPartialEq for Signal
Source§impl TS for Signal
impl TS for Signal
Source§const DOCS: Option<&'static str>
const DOCS: Option<&'static str>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§type WithoutGenerics = Signal
type WithoutGenerics = Signal
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<&'static Path>
fn output_path() -> Option<&'static Path>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use [
TS::export]. Read more§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use [
TS::export]. Read more§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
§fn default_output_path() -> Option<PathBuf>
fn default_output_path() -> Option<PathBuf>
T should be exported. Read more