Skip to main content

ViewRefInstalledLocalServerHandler

Trait ViewRefInstalledLocalServerHandler 

Source
pub trait ViewRefInstalledLocalServerHandler<___T: Transport = Channel> {
    // Required method
    fn watch(
        &mut self,
        request: Request<Watch, ___T>,
        responder: Responder<Watch, ___T>,
    ) -> impl Future<Output = ()>;
}
Expand description

A server handler for the ViewRefInstalled protocol.

See ViewRefInstalled for more details.

Required Methods§

Source

fn watch( &mut self, request: Request<Watch, ___T>, responder: Responder<Watch, ___T>, ) -> impl Future<Output = ()>

Sets up a callback to fire when the requested |view_ref| is installed.

  • If |view_ref| has not already been installed, the |Watch| response will fire when it is.
  • If |view_ref| has already been installed, the |Watch| response will fire immediately.
  • If |view_ref| is invalid, or becomes invalid (perhaps because the view was destroyed), the |Watch| call returns with an error. The error is not guaranteed to be immediate, but a ViewRef holder can itself determine ViewRef validity by listening for ZX_EVENTPAIR_PEER_CLOSED.

Flow control: The caller is allowed multiple |Watch| calls on multiple ViewRefs. There is at most one response per call back to the client.

Note: Prior to installation, this |Watch| call is kept alive as long as the ViewRef is valid.

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.

Implementations on Foreign Types§

Source§

impl<___H, ___T> ViewRefInstalledLocalServerHandler<___T> for Local<___H>
where ___H: ViewRefInstalledServerHandler<___T>, ___T: Transport,

Source§

async fn watch( &mut self, request: Request<Watch, ___T>, responder: Responder<Watch, ___T>, )

Implementors§