pub struct InstanceProxy { /* private fields */ }
Implementations§
Source§impl InstanceProxy
impl InstanceProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for examples.canvas.clientrequesteddraw/Instance.
Sourcepub fn take_event_stream(&self) -> InstanceEventStream
pub fn take_event_stream(&self) -> InstanceEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
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) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn ready(&self) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
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 Clone for InstanceProxy
impl Clone for InstanceProxy
Source§fn clone(&self) -> InstanceProxy
fn clone(&self) -> InstanceProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for InstanceProxy
impl Debug for InstanceProxy
Source§impl Proxy for InstanceProxy
impl Proxy for InstanceProxy
Source§type Protocol = InstanceMarker
type Protocol = InstanceMarker
Proxy
controls.