Trait remoc::rtc::ServerShared

source ·
pub trait ServerShared<Target, Codec>: ServerBase
where Self: Sized, Self::Client: Clone, Target: Send + Sync + 'static,
{ // Required methods fn new(target: Arc<Target>, request_buffer: usize) -> (Self, Self::Client); fn serve<'async_trait>( self, spawn: bool ) -> Pin<Box<dyn Future<Output = ()> + 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 shared reference.

Required Methods§

source

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

Creates a new server instance for a shared reference to the target object.

source

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

Serves the target object.

If spawn is true, remote calls are executed in parallel by spawning a task per call.

Serving ends when the client is dropped.

Object Safety§

This trait is not object safe.

Implementors§