Skip to main content

RpcServer

Trait RpcServer 

Source
pub trait RpcServer: Debug + Send {
    // Required methods
    fn connection_established(
        &self,
        member_id: MemberId,
        credential: Credential,
        connection: Box<dyn RpcConnection>,
    ) -> LocalBoxFuture<'static, Result<RpcConnectionSettings, RpcServerError>>;
    fn connection_closed(
        self: Box<Self>,
        member_id: MemberId,
        reason: ClosedReason,
    ) -> LocalBoxFuture<'static, ()>;
    fn send_command(&self, member_id: MemberId, msg: Command);
    fn synchronize(&self, member_id: MemberId) -> LocalBoxFuture<'static, ()>;
}
Expand description

Server side of Medea RPC protocol.

Required Methods§

Source

fn connection_established( &self, member_id: MemberId, credential: Credential, connection: Box<dyn RpcConnection>, ) -> LocalBoxFuture<'static, Result<RpcConnectionSettings, RpcServerError>>

Send signal of new RpcConnection being established with specified Member. Transport should consider dropping connection if message result is err.

Source

fn connection_closed( self: Box<Self>, member_id: MemberId, reason: ClosedReason, ) -> LocalBoxFuture<'static, ()>

Send signal of existing RpcConnection of specified Member being closed.

Source

fn send_command(&self, member_id: MemberId, msg: Command)

Sends Command.

Source

fn synchronize(&self, member_id: MemberId) -> LocalBoxFuture<'static, ()>

Sends Member’s request to synchronize its state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl RpcServer for Addr<Room>

Source§

fn connection_established( &self, member_id: MemberId, credentials: Credential, connection: Box<dyn RpcConnection>, ) -> LocalBoxFuture<'static, Result<RpcConnectionSettings, RpcServerError>>

Sends actix::Message to Room actor propagating errors.

§Errors

Errors with RpcServerError::RoomMailbox if message sending is failed.

Errors with RpcServerError::RoomError if Room returns error.

Source§

fn connection_closed( self: Box<Self>, member_id: MemberId, reason: ClosedReason, ) -> LocalBoxFuture<'static, ()>

Sends actix::Message to Room actor ignoring any errors.

Source§

fn send_command(&self, member_id: MemberId, msg: Command)

Sends actix::Message message to Room actor ignoring any errors.

Source§

fn synchronize(&self, member_id: MemberId) -> LocalBoxFuture<'static, ()>

Sends actix::Message to Room actor ignoring any errors.

Implementors§