pub enum ServerMessage {
Load {
request_id: Uuid,
instance_id: InstanceId,
graphic_id: String,
data: Option<Value>,
},
PlayAction {
request_id: Uuid,
instance_id: InstanceId,
goto: Option<f64>,
delta: Option<f64>,
skip_animation: Option<bool>,
},
StopAction {
request_id: Uuid,
instance_id: InstanceId,
skip_animation: Option<bool>,
},
UpdateAction {
request_id: Uuid,
instance_id: InstanceId,
data: Value,
skip_animation: Option<bool>,
},
CustomAction {
request_id: Uuid,
instance_id: InstanceId,
action_id: String,
payload: Value,
skip_animation: Option<bool>,
},
RendererCustomAction {
request_id: Uuid,
action_id: String,
payload: Value,
skip_animation: Option<bool>,
},
Clear {
request_id: Uuid,
instance_id: InstanceId,
},
}Expand description
Messages sent from the server to a renderer over its WebSocket. Every
variant carries a request_id so the HTTP handler that triggered it can
correlate the renderer’s eventual *Result reply (see RendererMessage)
and return the real statusCode/statusMessage, per the OGraf spec.
Variants§
Load
PlayAction
Fields
§
instance_id: InstanceIdStopAction
UpdateAction
CustomAction
Fields
§
instance_id: InstanceIdRendererCustomAction
A custom action invoked on the Renderer itself, not on a GraphicInstance.
Clear
Implementations§
Source§impl ServerMessage
impl ServerMessage
Sourcepub fn play_goto(
request_id: Uuid,
instance_id: InstanceId,
goto: f64,
skip_animation: Option<bool>,
) -> Self
pub fn play_goto( request_id: Uuid, instance_id: InstanceId, goto: f64, skip_animation: Option<bool>, ) -> Self
Smart constructor for PlayAction with goto — makes invalid state
(both goto and delta set) unrepresentable.
Sourcepub fn play_delta(
request_id: Uuid,
instance_id: InstanceId,
delta: f64,
skip_animation: Option<bool>,
) -> Self
pub fn play_delta( request_id: Uuid, instance_id: InstanceId, delta: f64, skip_animation: Option<bool>, ) -> Self
Smart constructor for PlayAction with delta — makes invalid state
(both goto and delta set) unrepresentable.
Sourcepub fn play_continue(
request_id: Uuid,
instance_id: InstanceId,
skip_animation: Option<bool>,
) -> Self
pub fn play_continue( request_id: Uuid, instance_id: InstanceId, skip_animation: Option<bool>, ) -> Self
Smart constructor for PlayAction with neither goto nor delta — continues from current step.
Trait Implementations§
Source§impl Clone for ServerMessage
impl Clone for ServerMessage
Source§impl Debug for ServerMessage
impl Debug for ServerMessage
Source§impl<'de> Deserialize<'de> for ServerMessage
impl<'de> Deserialize<'de> for ServerMessage
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
Auto Trait Implementations§
impl Freeze for ServerMessage
impl RefUnwindSafe for ServerMessage
impl Send for ServerMessage
impl Sync for ServerMessage
impl Unpin for ServerMessage
impl UnsafeUnpin for ServerMessage
impl UnwindSafe for ServerMessage
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