Skip to main content

EngineLink

Trait EngineLink 

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

Source

fn send(&mut self, message: ClientMessage)

Source

fn receive(&mut self) -> Vec<ServerMessage>

The messages that arrived since the last call.

Provided Methods§

Source

fn is_remote(&self) -> bool

Whether the messages travel over a network, where the connection can be interrupted.

Source

fn is_open(&self) -> bool

Whether the network connection is open.

Source

fn target(&self) -> Option<String>

Where the engine runs, if the interface should say so while it connects.

Source

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".

Implementors§