Struct LiveRouter
pub struct LiveRouter { /* private fields */ }Expand description
Client router for the REST API live data endpoints.
Implementations§
§impl LiveRouter
impl LiveRouter
pub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if the websocket connection is open.
pub fn connect(&mut self) -> Result<()>
pub fn connect(&mut self) -> Result<()>
Opens the websocket connection.
The router timeout bounds the entire connection process: the TCP
connect phase uses it as a connect timeout, and it is applied as the
socket read and write timeout before the TLS and WebSocket handshake.
This ensures a stalled or hanging host cannot block for longer than
timeout_s, and that live operations afterwards cannot block
indefinitely if the server stalls.
pub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Closes the websocket connection (no-op if not connected).
pub fn set_data(
&mut self,
data: IndexMap<String, InstructionValue>,
) -> Result<()>
pub fn set_data( &mut self, data: IndexMap<String, InstructionValue>, ) -> Result<()>
Sets data via the websocket connection.
Keys addressing an object or material that does not exist in the scene are discarded by the server. This reports success and logs a warning naming them, because a second client may legitimately delete an object while this one is still streaming updates for it. The warning is issued at most once per second and counts the calls folded into it.