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
§type Protocol = InstanceMarker
type Protocol = InstanceMarker
Proxy
controls.source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for InstanceProxy
impl !RefUnwindSafe for InstanceProxy
impl Send for InstanceProxy
impl Sync for InstanceProxy
impl Unpin for InstanceProxy
impl !UnwindSafe for InstanceProxy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)