Skip to main content

StoreLocalServerHandler

Trait StoreLocalServerHandler 

Source
pub trait StoreLocalServerHandler<___T: Transport = Channel> {
    // Required method
    fn write_item(
        &mut self,
        request: Request<WriteItem, ___T>,
        responder: Responder<WriteItem, ___T>,
    ) -> impl Future<Output = ()>;

    // Provided method
    fn on_unknown_interaction(
        &mut self,
        ordinal: u64,
    ) -> impl Future<Output = ()> { ... }
}
Expand description

A server handler for the Store protocol.

See Store for more details.

Required Methods§

Source

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

Writes an item to the store.

Since the value stored in the key-value store can now be different from the input (if the WriteOptions.CONCAT flag is set), we need to return the resulting Value to the requester.

We use an (anonymous) table and a (named) flexible union as the request and response payload, respectively, to allow for easier future evolution. Both of these types are flexible, meaning that adding or removing members is binary-compatible. This makes them much easier to evolve that the struct types that were previously used, which cannot be changed after release without breaking ABI.

Provided Methods§

Source

fn on_unknown_interaction(&mut self, ordinal: u64) -> impl Future<Output = ()>

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

Source§

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

Source§

async fn on_unknown_interaction(&mut self, ordinal: u64)

Implementors§