ProtoHttp1ClientLayer

Struct ProtoHttp1ClientLayer 

Source
pub struct ProtoHttp1ClientLayer<Svc>
where Svc: Service<(ReadHalf<SimplexStream>, WriteHalf<SimplexStream>), 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> ProtoHttp1ClientLayer<Svc>
where Svc: Service<(ReadHalf<SimplexStream>, WriteHalf<SimplexStream>), Response = ()> + Send + Clone,

Source

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

Create a new instance of the service

Trait Implementations§

Source§

impl<Svc, SvcError, SvcFut> Service<HTTP1Request> for ProtoHttp1ClientLayer<Svc>
where Svc: Service<(ReadHalf<SimplexStream>, WriteHalf<SimplexStream>), Response = (), Error = SvcError, Future = SvcFut> + Send + Clone + 'static, SvcFut: Future<Output = Result<(), SvcError>> + Send,

Source§

type Response = HTTP1ClientResponse<ReadHalf<SimplexStream>, WriteHalf<SimplexStream>>

The response is handled by the protocol

Source§

type Error = ProtoHttp1LayerError<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<<ProtoHttp1ClientLayer<Svc> as Service<HTTP1Request>>::Response, <ProtoHttp1ClientLayer<Svc> as Service<HTTP1Request>>::Error>> + Send>>

The future is the protocol itself

Source§

fn call(&mut self, request: HTTP1Request) -> 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 ProtoHttp1ClientLayer<Svc>
where Svc: Freeze,

§

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

§

impl<Svc> Send for ProtoHttp1ClientLayer<Svc>

§

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

§

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

§

impl<Svc> UnwindSafe for ProtoHttp1ClientLayer<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.