pub enum ClientMessage {
Connect {
protocol: String,
session_id: Option<String>,
last_revision: Option<u64>,
resume_token: Option<String>,
tenant_id: Option<String>,
trace_id: Option<String>,
span_id: Option<String>,
parent_span_id: Option<String>,
correlation_id: Option<String>,
request_id: Option<String>,
},
Event {
event: String,
target: Option<String>,
value: Value,
metadata: Map<String, Value>,
},
Ping {
nonce: Option<String>,
},
PatchUrl {
to: String,
},
Navigate {
to: String,
},
UploadStart {
upload_id: String,
event: String,
target: Option<String>,
name: String,
size: u64,
content_type: Option<String>,
},
UploadChunk {
upload_id: String,
offset: u64,
data: String,
},
UploadComplete {
upload_id: String,
},
}Expand description
Message received from the browser runtime.
Variants§
Connect
Initial protocol negotiation from the browser runtime.
Fields
Event
Browser event captured by the Shelly JavaScript client.
Ping
Health check from the browser.
PatchUrl
Request an internal URL patch on the current LiveView route.
Request an internal navigation to another LiveView route.
UploadStart
Negotiate a new upload before sending chunks.
Fields
UploadChunk
Send one base64-encoded upload chunk.
UploadComplete
Finish an upload after all chunks have been sent.
Trait Implementations§
Source§impl Clone for ClientMessage
impl Clone for ClientMessage
Source§fn clone(&self) -> ClientMessage
fn clone(&self) -> ClientMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientMessage
impl Debug for ClientMessage
Source§impl<'de> Deserialize<'de> for ClientMessage
impl<'de> Deserialize<'de> for ClientMessage
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ClientMessage
impl PartialEq for ClientMessage
Source§fn eq(&self, other: &ClientMessage) -> bool
fn eq(&self, other: &ClientMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ClientMessage
impl Serialize for ClientMessage
Source§impl TryFrom<ClientMessage> for Event
impl TryFrom<ClientMessage> for Event
Source§type Error = ShellyError
type Error = ShellyError
The type returned in the event of a conversion error.
impl StructuralPartialEq for ClientMessage
Auto Trait Implementations§
impl Freeze for ClientMessage
impl RefUnwindSafe for ClientMessage
impl Send for ClientMessage
impl Sync for ClientMessage
impl Unpin for ClientMessage
impl UnsafeUnpin for ClientMessage
impl UnwindSafe for ClientMessage
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