pub struct Accepting<S: Service, C: Listener<S>> { /* private fields */ }
Expand description
The result of accepting a new connection.
Implementations§
Source§impl<S: Service, C: Listener<S>> Accepting<S, C>
impl<S: Service, C: Listener<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>
impl<S, C> RefUnwindSafe for Accepting<S, C>where
<C as StreamTypes>::SendSink: RefUnwindSafe,
<C as StreamTypes>::RecvStream: RefUnwindSafe,
S: 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>where
S: Unpin,
impl<S, C> UnwindSafe for Accepting<S, C>where
<C as StreamTypes>::SendSink: UnwindSafe,
<C as StreamTypes>::RecvStream: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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