Skip to main content

ItemsServerHandler

Trait ItemsServerHandler 

Source
pub trait ItemsServerHandler<___T: Transport = Channel> {
    // Required methods
    fn get(
        &mut self,
        request: Request<Get, ___T>,
        responder: Responder<Get, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get2(
        &mut self,
        request: Request<Get2, ___T>,
        responder: Responder<Get2, ___T>,
    ) -> impl Future<Output = ()> + Send;
    fn get_bootloader_file(
        &mut self,
        request: Request<GetBootloaderFile, ___T>,
        responder: Responder<GetBootloaderFile, ___T>,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

A server handler for the Items protocol.

See Items for more details.

Required Methods§

Source

fn get( &mut self, request: Request<Get, ___T>, responder: Responder<Get, ___T>, ) -> impl Future<Output = ()> + Send

Get a payload for a boot item of type and extra. NOTE: We return the length of the item, as VMOs must be page-aligned.

TODO: Refactor API: https://fxbug.dev/42109921

For a list of types, refer to <lib/zbi-format/zbi.h>. For a list of extras, refer to <lib/zbi-format/driver-config.h>.

Source

fn get2( &mut self, request: Request<Get2, ___T>, responder: Responder<Get2, ___T>, ) -> impl Future<Output = ()> + Send

Get all stored items of type, optionally also restricted by extra. Note that length is returned for each item as VMOs are page-aligned.

Returns ZX_ERR_NOT_SUPPORTED if this is an untracked item which will never be stored.

Source

fn get_bootloader_file( &mut self, request: Request<GetBootloaderFile, ___T>, responder: Responder<GetBootloaderFile, ___T>, ) -> impl Future<Output = ()> + Send

Gets the payload for a ZBI_TYPE_BOOTLOADER_FILE boot item. Note: ZX_PROP_VMO_CONTENT_SIZE will be set to the actual file content size

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§