Trait remoc::rtc::ServerSharedMut

source ·
pub trait ServerSharedMut<Target, Codec>: ServerBase
where Self: Sized, Target: Send + Sync + 'static,
{ // Required methods fn new( target: Arc<LocalRwLock<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 mutable reference.

Required Methods§

source

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

Creates a new server instance for a shared mutable 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 taking a &self reference are executed in parallel by spawning a task per call. Remote calls taking a &mut self reference are serialized by obtaining a write lock.

Serving ends when the client is dropped.

Object Safety§

This trait is not object safe.

Implementors§