pub trait EngineLink {
// Required methods
fn send(&mut self, message: ClientMessage);
fn receive(&mut self) -> Vec<ServerMessage>;
// Provided methods
fn is_remote(&self) -> bool { ... }
fn is_open(&self) -> bool { ... }
fn target(&self) -> Option<String> { ... }
fn background_sender(&self) -> Option<BackgroundSender> { ... }
}Expand description
How messages reach the engine and come back.
Required Methods§
fn send(&mut self, message: ClientMessage)
Sourcefn receive(&mut self) -> Vec<ServerMessage>
fn receive(&mut self) -> Vec<ServerMessage>
The messages that arrived since the last call.
Provided Methods§
Sourcefn is_remote(&self) -> bool
fn is_remote(&self) -> bool
Whether the messages travel over a network, where the connection can be interrupted.
Sourcefn target(&self) -> Option<String>
fn target(&self) -> Option<String>
Where the engine runs, if the interface should say so while it connects.
Sourcefn background_sender(&self) -> Option<BackgroundSender>
fn background_sender(&self) -> Option<BackgroundSender>
Sends from any thread, without waiting for the interface’s next frame, where the link can.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".