pub struct ProtocolNegotiation<Io> { /* private fields */ }Implementations§
Source§impl<Io> ProtocolNegotiation<Io>
impl<Io> ProtocolNegotiation<Io>
pub fn new(proto: ProtocolId) -> Self
pub fn framed(stream: Io) -> Framed<Io, ProtocolIdCodec>where
Io: AsyncRead + AsyncWrite,
Trait Implementations§
Source§impl<Io> Clone for ProtocolNegotiation<Io>
impl<Io> Clone for ProtocolNegotiation<Io>
Source§impl<Io> Default for ProtocolNegotiation<Io>
impl<Io> Default for ProtocolNegotiation<Io>
Source§impl<Io> Service for ProtocolNegotiation<Io>where
Io: AsyncRead + AsyncWrite + 'static,
impl<Io> Service for ProtocolNegotiation<Io>where
Io: AsyncRead + AsyncWrite + 'static,
Source§type Request = Framed<Io, ProtocolIdCodec>
type Request = Framed<Io, ProtocolIdCodec>
Requests handled by the service.
Source§type Response = Framed<Io, ProtocolIdCodec>
type Response = Framed<Io, ProtocolIdCodec>
Responses given by the service.
Source§type Error = ProtocolIdError
type Error = ProtocolIdError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<ProtocolNegotiation<Io> as Service>::Response, <ProtocolNegotiation<Io> as Service>::Error>>>>
type Future = Pin<Box<dyn Future<Output = Result<<ProtocolNegotiation<Io> as Service>::Response, <ProtocolNegotiation<Io> as Service>::Error>>>>
The future response value.
Source§fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready when the service is able to process requests. Read moreSource§fn call(&mut self, framed: Framed<Io, ProtocolIdCodec>) -> Self::Future
fn call(&mut self, framed: Framed<Io, ProtocolIdCodec>) -> Self::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations§
impl<Io> Freeze for ProtocolNegotiation<Io>
impl<Io> RefUnwindSafe for ProtocolNegotiation<Io>where
Io: RefUnwindSafe,
impl<Io> Send for ProtocolNegotiation<Io>where
Io: Send,
impl<Io> Sync for ProtocolNegotiation<Io>where
Io: Sync,
impl<Io> Unpin for ProtocolNegotiation<Io>where
Io: Unpin,
impl<Io> UnwindSafe for ProtocolNegotiation<Io>where
Io: 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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoService<T> for Twhere
T: Service,
impl<T> IntoService<T> for Twhere
T: Service,
Source§fn into_service(self) -> T
fn into_service(self) -> T
Convert to a
Service