Skip to main content

StoreServerHandler

Trait StoreServerHandler 

Source
pub trait StoreServerHandler<___T = Channel>
where ___T: Transport,
{ // Required method fn write_item( &mut self, request: Request<WriteItem, ___T>, responder: Responder<WriteItem, ___T>, ) -> impl Future<Output = ()> + Send; // Provided method fn on_unknown_interaction( &mut self, ordinal: u64, ) -> impl Future<Output = ()> + Send { ... } }
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 = ()> + Send

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 = ()> + Send

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.

Implementors§