pub struct RpcServer<S, C> { /* private fields */ }
Expand description
A server channel for a specific service.
This is a wrapper around a ServiceEndpoint that serves as the entry point for the server DSL.
S
is the service type, C
is the channel type.
Implementations§
source§impl<S: Service, C: ServiceEndpoint<S>> RpcServer<S, C>
impl<S: Service, C: ServiceEndpoint<S>> RpcServer<S, C>
sourcepub fn new(source: C) -> Self
pub fn new(source: C) -> Self
Create a new rpc server for a specific service for a Service given a compatible ServiceEndpoint.
This is where a generic typed endpoint is converted into a server for a specific service.
source§impl<S: Service, C: ServiceEndpoint<S>> RpcServer<S, C>
impl<S: Service, C: ServiceEndpoint<S>> RpcServer<S, C>
sourcepub async fn accept(&self) -> Result<Accepting<S, C>, RpcServerError<C>>
pub async fn accept(&self) -> Result<Accepting<S, C>, RpcServerError<C>>
Accepts a new channel from a client. The result is an Accepting object that can be used to read the first request.
sourcepub fn into_inner(self) -> C
pub fn into_inner(self) -> C
Get the underlying service endpoint
Trait Implementations§
Auto Trait Implementations§
impl<S, C> Freeze for RpcServer<S, C>where
C: Freeze,
impl<S, C> RefUnwindSafe for RpcServer<S, C>where
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, C> Send for RpcServer<S, C>
impl<S, C> Sync for RpcServer<S, C>
impl<S, C> Unpin for RpcServer<S, C>
impl<S, C> UnwindSafe for RpcServer<S, C>where
C: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)