pub enum Command {
Show 13 variants
SendWebSocket {
frame: String,
},
ApplyNegotiation {
request_id: RequestId,
kind: NegotiationKind,
sdp: String,
upload_slots: Vec<NegotiationUploadSlot>,
},
ClosePeerConnection,
CloseWebSocket {
code: u16,
},
EmitStateChange {
state: ConnectionState,
cause: Option<String>,
},
SetAvailableFeatures {
features: AvailableFeatures,
},
SetRecordingState {
state: RecordingState,
},
EmitEvent {
event: ProtocolEvent,
},
BeginPendingRequest {
request: PendingRequest,
},
CompletePendingRequest {
request_id: RequestId,
timeout_timer_id: u32,
ok: bool,
},
ScheduleTimer {
id: u32,
ms: u32,
},
CancelTimer {
id: u32,
},
Connect {
url: String,
},
}Expand description
One ordered side effect for the host that drives ProtocolCore.
The host must execute each returned vector before reporting follow-up events.
Variants§
SendWebSocket
Serialize and send a JSON frame over the WebSocket.
ApplyNegotiation
Apply a remote SDP offer to the local RTCPeerConnection.
ClosePeerConnection
CloseWebSocket
EmitStateChange
Notify listeners of a connection-state transition, with an optional
human-readable cause (e.g. "kicked", "full").
SetAvailableFeatures
Fields
§
features: AvailableFeaturesSetRecordingState
Fields
§
state: RecordingStateEmitEvent
Emit a protocol-domain event for the host projection layer.
Fields
§
event: ProtocolEventBeginPendingRequest
Fields
§
request: PendingRequestCompletePendingRequest
Cancel timeout_timer_id before resolving request_id.
ScheduleTimer
Start a one-shot timer; the host must call ProtocolCore::on_timer
when it fires.
CancelTimer
Connect
Open a new WebSocket to the given URL.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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