Skip to main content

ServerMessage

Enum ServerMessage 

Source
pub enum ServerMessage {
Show 27 variants Hello { session_id: String, target: String, revision: u64, protocol: String, server_revision: Option<u64>, resume_status: Option<ResumeStatus>, resume_reason: Option<String>, resume_token: Option<String>, resume_expires_in_ms: Option<u64>, }, Patch { target: String, html: String, revision: u64, }, Diff { target: String, revision: u64, slots: Vec<DynamicSlotPatch>, }, StreamInsert { target: String, id: String, html: String, at: StreamPosition, }, StreamDelete { target: String, id: String, }, StreamBatch { target: String, operations: Vec<StreamBatchOperation>, }, ChartSeriesAppend { chart: String, series: String, point: ChartPoint, }, ChartSeriesAppendMany { chart: String, series: String, points: Vec<ChartPoint>, }, ChartSeriesReplace { chart: String, series: String, points: Vec<ChartPoint>, }, ChartReset { chart: String, }, ChartAnnotationUpsert { chart: String, annotation: ChartAnnotation, }, ChartAnnotationDelete { chart: String, id: String, }, ToastPush { toast: Toast, }, ToastDismiss { id: String, }, InboxUpsert { item: InboxItem, }, InboxDelete { id: String, }, GridReplace { grid: String, state: GridState, }, GridRowsReplace { grid: String, window: GridRowsWindow, }, InteropDispatch { dispatch: JsInteropDispatch, }, Pong { nonce: Option<String>, }, Redirect { to: String, }, PatchUrl { to: String, }, Navigate { to: String, }, UploadProgress { upload_id: String, received: u64, total: u64, }, UploadComplete { upload_id: String, name: String, size: u64, content_type: Option<String>, }, UploadError { upload_id: String, message: String, code: Option<String>, }, Error { message: String, code: Option<String>, },
}
Expand description

Message sent from the Rust runtime to the browser runtime.

Variants§

§

Hello

Sent when the WebSocket is established.

Fields

§session_id: String
§target: String
§revision: u64
§protocol: String
§server_revision: Option<u64>
§resume_status: Option<ResumeStatus>
§resume_reason: Option<String>
§resume_token: Option<String>
§resume_expires_in_ms: Option<u64>
§

Patch

Replace or morph a target node’s inner content.

Fields

§target: String
§html: String
§revision: u64
§

Diff

Replace changed dynamic slots within a previously patched template.

Fields

§target: String
§revision: u64
§

StreamInsert

Insert one rendered item into a browser stream.

Fields

§target: String
§html: String
§

StreamDelete

Delete one rendered item from a browser stream.

Fields

§target: String
§

StreamBatch

Apply many stream operations in one message.

Fields

§target: String
§

ChartSeriesAppend

Append one point into a browser-managed chart series.

Fields

§chart: String
§series: String
§

ChartSeriesAppendMany

Append many points into one browser-managed chart series.

Fields

§chart: String
§series: String
§points: Vec<ChartPoint>
§

ChartSeriesReplace

Replace one chart series with a full point set.

Fields

§chart: String
§series: String
§points: Vec<ChartPoint>
§

ChartReset

Clear all chart series data for one chart.

Fields

§chart: String
§

ChartAnnotationUpsert

Insert or replace one chart annotation.

Fields

§chart: String
§annotation: ChartAnnotation
§

ChartAnnotationDelete

Delete one chart annotation.

Fields

§chart: String
§

ToastPush

Push one toast notification.

Fields

§toast: Toast
§

ToastDismiss

Dismiss one toast notification by id.

Fields

§

InboxUpsert

Insert or replace one inbox item.

Fields

§

InboxDelete

Delete one inbox item.

Fields

§

GridReplace

Replace one enterprise grid state snapshot.

Fields

§grid: String
§

GridRowsReplace

Replace only the active row window of one enterprise grid.

Fields

§grid: String
§

InteropDispatch

Dispatch one browser-side interop event.

Fields

§

Pong

Reply to a ping.

Fields

§

Redirect

Navigate the browser to another URL.

Fields

§

PatchUrl

Patch the browser URL using history.pushState without replacing the view.

Fields

§

Navigate

Navigate to another internal LiveView route using history.pushState.

Fields

§

UploadProgress

Report upload transfer progress.

Fields

§upload_id: String
§received: u64
§total: u64
§

UploadComplete

Report a completed upload.

Fields

§upload_id: String
§name: String
§size: u64
§content_type: Option<String>
§

UploadError

Report an upload-specific validation or transport error.

Fields

§upload_id: String
§message: String
§

Error

Report a recoverable server-side error.

Fields

§message: String

Trait Implementations§

Source§

impl Clone for ServerMessage

Source§

fn clone(&self) -> ServerMessage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ServerMessage

Source§

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

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

impl<'de> Deserialize<'de> for ServerMessage

Source§

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 ServerMessage

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Serialize for ServerMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ServerMessage

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,