pub struct Accepting<S: Service, C: ServiceEndpoint<S>> { /* private fields */ }
Expand description
The result of accepting a new connection.
Implementations§
source§impl<S: Service, C: ServiceEndpoint<S>> Accepting<S, C>
impl<S: Service, C: ServiceEndpoint<S>> Accepting<S, C>
sourcepub async fn read_first(
self,
) -> Result<(S::Req, RpcChannel<S, C>), RpcServerError<C>>
pub async fn read_first( self, ) -> Result<(S::Req, RpcChannel<S, C>), RpcServerError<C>>
Read the first message from the client.
The return value is a tuple of (request, channel)
. Here request
is the
first request which is already read from the stream. The channel
is a
RpcChannel that has sink
and stream
fields that can be used to send more
requests and/or receive more responses.
Often sink and stream will wrap an an underlying byte stream. In this case you can call into_inner() on them to get it back to perform byte level reads and writes.
Auto Trait Implementations§
impl<S, C> Freeze for Accepting<S, C>where
<C as ConnectionCommon<<S as Service>::Req, <S as Service>::Res>>::SendSink: Freeze,
<C as ConnectionCommon<<S as Service>::Req, <S as Service>::Res>>::RecvStream: Freeze,
impl<S, C> RefUnwindSafe for Accepting<S, C>where
<C as ConnectionCommon<<S as Service>::Req, <S as Service>::Res>>::SendSink: RefUnwindSafe,
<C as ConnectionCommon<<S as Service>::Req, <S as Service>::Res>>::RecvStream: RefUnwindSafe,
impl<S, C> Send for Accepting<S, C>
impl<S, C> Sync for Accepting<S, C>
impl<S, C> Unpin for Accepting<S, C>
impl<S, C> UnwindSafe for Accepting<S, C>where
<C as ConnectionCommon<<S as Service>::Req, <S as Service>::Res>>::SendSink: UnwindSafe,
<C as ConnectionCommon<<S as Service>::Req, <S as Service>::Res>>::RecvStream: 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