pub trait GenServer {
    type Message;
    type Response;
    type Registry;
    type CallResponse<'a>: Future<Output = Self::Response>
   where
        Self: 'a
; type CastResponse<'a>: Future<Output = ()>
   where
        Self: 'a
; fn new(registry: Self::Registry) -> Self; fn handle_call(&mut self, message: Self::Message) -> Self::CallResponse<'_>; fn handle_cast(&mut self, message: Self::Message) -> Self::CastResponse<'_>; fn channel_queue_size() -> usize { ... } }
Expand description

The GenServer trait lets you generate a server, by implementing the trait.

Required Associated Types

Specifies the type of messages this server can receive.

Specifies the response from calls.

Specifies the name of the registry type created with make_registry.

Specifies the call response type, which must implement std::future::Future.

Specifies the call response type, which must implement std::future::Future and return ().

Required Methods

Creates a new server, and receives a copy of the current registry.

You should never need to call this method yourself, as it’s called for you by the registry.

This function will be called whenever this server receives a call.

This function will be called whenever this server receives a cast.

Provided Methods

Reimplement this method to change the channel queue size for your server. Defaults to 1000 messages.

Implementors