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.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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)