Trait rotor_capnp::Endpoint [] [src]

pub trait Endpoint: Sized {
    type Context;
    type Socket: StreamSocket;
    type Seed;
    fn create(
        seed: Self::Seed,
        sock: &mut Self::Socket,
        scope: &mut Scope<Self::Context>
    ) -> Action<Self>; fn message_received(
        self,
        message: &MessageReader,
        output: MessageWriter,
        scope: &mut Scope<Self::Context>
    ) -> Action<Self>; fn message_flushed(
        self,
        output: MessageWriter,
        scope: &mut Scope<Self::Context>
    ) -> Action<Self>; fn recv_timeout(&self, scope: &mut Scope<Self::Context>) -> Duration; fn send_timeout(&self, scope: &mut Scope<Self::Context>) -> Duration; fn timeout(
        self,
        state: ConnectionState,
        output: MessageWriter,
        scope: &mut Scope<Self::Context>
    ) -> Action<Self>; fn wakeup(&self, scope: &mut Scope<Self::Context>) -> Action<Self>; fn exception(self, err: Error, scope: &mut Scope<Self::Context>); fn reader_options(&self, _scope: &mut Scope<Self::Context>) -> ReaderOptions { ... } fn idle_timeout(&self, _scope: &mut Scope<Self::Context>) -> Duration { ... } }

A handler for receiving and sending Cap'n Proto messages.

Currently this is used by both client side and server side of the connection. Client specific abstractions might be added in the future.

Associated Types

Context shared between transitions of the state machine.

Type of the underlying socket.

Seed for initializing the state machine.

Required Methods

A new connection has been established.

A new message has been received.

All outgoing messages have been flushed.

Timeout for reading a message.

Timeout for sending a message.

Timeout expired during the state.

The state machine has been woken up.

Connection will be closed after this.

Provided Methods

Options for the Cap'n Proto message reader.

Timeout for an idle connection. By default it's 120 seconds.

Implementors