ProtoHttp2Layer

Struct ProtoHttp2Layer 

Source
pub struct ProtoHttp2Layer<Svc>
where Svc: Service<(Receiver<Http2Frame>, Sender<Http2Frame>), Response = ()> + Send + Clone,
{ /* private fields */ }
Expand description

A service to process HTTP/1.1 requests

This should not be constructed directly - it gets created by MakeService during invocation.

Implementations§

Source§

impl<Svc> ProtoHttp2Layer<Svc>
where Svc: Service<(Receiver<Http2Frame>, Sender<Http2Frame>), Response = ()> + Send + Clone,

Source

pub fn new(config: ProtoHttp2Config, inner: Svc) -> Self

Create a new instance of the service

Trait Implementations§

Source§

impl<Reader, Writer, Svc, SvcError, SvcFut> Service<(Reader, Writer)> for ProtoHttp2Layer<Svc>
where Reader: AsyncReadExt + Send + Unpin + 'static, Writer: AsyncWriteExt + Send + Unpin + 'static, Svc: Service<(Receiver<Http2Frame>, Sender<Http2Frame>), Response = (), Error = SvcError, Future = SvcFut> + Send + Clone + 'static, SvcFut: Future<Output = Result<(Receiver<Http2Frame>, Sender<Http2Frame>), SvcError>> + Send + 'static, SvcError: Debug + Send + 'static,

Source§

type Response = ()

The response is handled by the protocol

Source§

type Error = ProtoHttp2Error<SvcError>

Errors would be failures in parsing the protocol - this should be handled by the protocol

Source§

type Future = Pin<Box<dyn Future<Output = Result<<ProtoHttp2Layer<Svc> as Service<(Reader, Writer)>>::Response, <ProtoHttp2Layer<Svc> as Service<(Reader, Writer)>>::Error>> + Send>>

The future is the protocol itself

Source§

fn call(&mut self, (reader, writer): (Reader, Writer)) -> Self::Future

Indefinitely process the protocol

Source§

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more

Auto Trait Implementations§

§

impl<Svc> Freeze for ProtoHttp2Layer<Svc>
where Svc: Freeze,

§

impl<Svc> RefUnwindSafe for ProtoHttp2Layer<Svc>
where Svc: RefUnwindSafe,

§

impl<Svc> Send for ProtoHttp2Layer<Svc>

§

impl<Svc> Sync for ProtoHttp2Layer<Svc>
where Svc: Sync,

§

impl<Svc> Unpin for ProtoHttp2Layer<Svc>
where Svc: Unpin,

§

impl<Svc> UnwindSafe for ProtoHttp2Layer<Svc>
where Svc: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.