Trait remoc::rtc::Server

source ·
pub trait Server<Target, Codec>: ServerBase
where Self: Sized, Target: Send + Sync + 'static,
{ // Required methods fn new(target: Target, request_buffer: usize) -> (Self, Self::Client); fn serve<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Option<Target>> + Send + 'async_trait>> where Self: 'async_trait; }
Available on crate feature rtc only.
Expand description

A server of a remotable trait taking the target object by value.

Required Methods§

source

fn new(target: Target, request_buffer: usize) -> (Self, Self::Client)

Creates a new server instance for the target object.

source

fn serve<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Option<Target>> + Send + 'async_trait>>
where Self: 'async_trait,

Serves the target object.

Serving ends when the client is dropped or a method taking self by value is called. In the first case, the target object is returned and, in the second case, None is returned.

Object Safety§

This trait is not object safe.

Implementors§