Trait ServerRef

Source
pub trait ServerRef<'target, Target, Codec>: ServerBase
where Self: Sized,
{ // Required methods fn new( target: &'target Target, request_buffer: usize, ) -> (Self, Self::Client); fn serve<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), ServeError>> + '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 reference.

Required Methods§

Source

fn new(target: &'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 = Result<(), ServeError>> + 'async_trait>>
where Self: 'async_trait,

Serves the target object.

Serving ends when the client is dropped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§