Skip to main content

ViewLocalServerHandler

Trait ViewLocalServerHandler 

Source
pub trait ViewLocalServerHandler<___T: Transport = Channel> {
    // Required method
    fn present(
        &mut self,
        request: Request<Present, ___T>,
    ) -> impl Future<Output = ()>;
}
Expand description

A server handler for the View protocol.

See View for more details.

Required Methods§

Source

fn present( &mut self, request: Request<Present, ___T>, ) -> impl Future<Output = ()>

Provides the View with an attachment point to Scenic’s scene graph.

When Present() is called the View’s implementation should create a View resource within Scenic by providing it with the view_token (using a fuchsia.ui.gfx.CreateResourceCmd and fuchsia.ui.gfx.ViewArgs).

Then the implementation should attach its graphical content to the newly-created View resource using a fuchsia.ui.gfx.AddChildCmd.

If the implementation already owns a View resource (because Present() had already been called before), then it should terminate the connection with an error.

TODO(https://fxbug.dev/42098670): Allow re-parenting Views with a new Present() call.

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> ViewLocalServerHandler<___T> for Local<___H>
where ___H: ViewServerHandler<___T>, ___T: Transport,

Source§

async fn present(&mut self, request: Request<Present, ___T>)

Implementors§