pub trait InstanceLocalServerHandler<___T: Transport = Channel> {
// Required methods
fn add_lines(
&mut self,
request: Request<AddLines, ___T>,
) -> impl Future<Output = ()>;
fn ready(
&mut self,
responder: Responder<Ready, ___T>,
) -> impl Future<Output = ()>;
// Provided method
fn on_unknown_interaction(
&mut self,
ordinal: u64,
) -> impl Future<Output = ()> { ... }
}Expand description
A server handler for the Instance protocol.
See Instance for more details.
Required Methods§
Sourcefn add_lines(
&mut self,
request: Request<AddLines, ___T>,
) -> impl Future<Output = ()>
fn add_lines( &mut self, request: Request<AddLines, ___T>, ) -> impl Future<Output = ()>
Add multiple lines to the canvas. We are able to reduce protocol chatter and the number of
requests needed by batching instead of calling the simpler AddLine(...) one line at a
time.
Sourcefn ready(
&mut self,
responder: Responder<Ready, ___T>,
) -> impl Future<Output = ()>
fn ready( &mut self, responder: Responder<Ready, ___T>, ) -> impl Future<Output = ()>
Rather than the server randomly performing draws, or trying to guess when to do so, the client must explicitly ask for them. This creates a bit of extra chatter with the additional method invocation, but allows much greater client-side control of when the canvas is “ready” for a view update, thereby eliminating unnecessary draws.
This method also has the benefit of “throttling” the -> OnDrawn(...) event - rather than
allowing a potentially unlimited flood of -> OnDrawn(...) calls, we now have the runtime
enforced semantic that each -> OnDrawn(...) call must follow a unique Ready() -> () call
from the client. An unprompted -> OnDrawn(...) is invalid, and should cause the channel to
immediately close.
Provided Methods§
fn on_unknown_interaction(&mut self, ordinal: u64) -> impl Future<Output = ()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.