pub struct InstanceSynchronousProxy { /* private fields */ }
Implementations§
Source§impl InstanceSynchronousProxy
impl InstanceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<InstanceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<InstanceEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn add_lines(&self, lines: &[[Point; 2]]) -> Result<(), Error>
pub fn add_lines(&self, lines: &[[Point; 2]]) -> Result<(), Error>
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.
Sourcepub fn ready(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
pub fn ready(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
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.
Trait Implementations§
Source§impl Debug for InstanceSynchronousProxy
impl Debug for InstanceSynchronousProxy
Source§impl SynchronousProxy for InstanceSynchronousProxy
impl SynchronousProxy for InstanceSynchronousProxy
Source§type Proxy = InstanceProxy
type Proxy = InstanceProxy
Source§type Protocol = InstanceMarker
type Protocol = InstanceMarker
Proxy
controls.