ClientContext

Struct ClientContext 

Source
pub struct ClientContext(/* private fields */);
Available on crate feature client only.
Expand description

RPC context of http client

Implementations§

Source§

impl ClientContext

Source

pub fn new() -> Self

Create a new ClientContext

Methods from Deref<Target = RpcCx<ClientCxInner, Config>>§

Source

pub fn reset(&mut self, inner: I)

Trait Implementations§

Source§

impl Apply<ClientContext> for CallOpt

Source§

type Error = ClientError

Source§

fn apply(self, cx: &mut ClientContext) -> Result<(), Self::Error>

Source§

impl Apply<ClientContext> for Target

Source§

type Error = ClientError

Source§

fn apply(self, cx: &mut ClientContext) -> Result<(), Self::Error>

Source§

impl Context for ClientContext

Source§

type Config = Config

Source§

fn rpc_info(&self) -> &RpcInfo<Self::Config>

Source§

fn rpc_info_mut(&mut self) -> &mut RpcInfo<Self::Config>

Source§

fn extensions_mut(&mut self) -> &mut Extensions

Source§

fn extensions(&self) -> &Extensions

Source§

impl Debug for ClientContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClientContext

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for ClientContext

Source§

type Target = RpcCx<ClientCxInner, Config>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for ClientContext

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<ReqBody, RespBody> OneShotService<ClientContext, Request<ReqBody>> for Client<ReqBody, RespBody>
where ReqBody: Send,

Source§

type Response = Response<RespBody>

Responses given by the service.
Source§

type Error = ClientError

Errors produced by the service.
Source§

async fn call( self, cx: &mut ClientContext, req: Request<ReqBody>, ) -> Result<Self::Response, Self::Error>

Process the request and return the response asynchronously.
Source§

impl<B> Service<ClientContext, Request<B>> for ClientTransport<B>
where B: Body + Unpin + Send + 'static, B::Data: Send, B::Error: Into<Box<dyn Error + Send + Sync>> + 'static,

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = ClientError

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ClientContext, req: Request<B>, ) -> Result<Self::Response, Self::Error>

Available on crate feature service_send only.
Process the request and return the response asynchronously.
Source§

impl<B, S> Service<ClientContext, Request<B>> for HostService<S>

Source§

type Response = <S as Service<ClientContext, Request<B>>>::Response

Responses given by the service.
Source§

type Error = <S as Service<ClientContext, Request<B>>>::Error

Errors produced by the service.
Source§

fn call( &self, cx: &mut ClientContext, req: Request<B>, ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send

Available on crate feature service_send only.
Process the request and return the response asynchronously.
Source§

impl<B, S> Service<ClientContext, Request<B>> for HttpProxyService<S>
where B: Send, S: Service<ClientContext, Request<B>, Error = ClientError> + Send + Sync,

Available on crate feature http1 only.
Source§

type Response = <S as Service<ClientContext, Request<B>>>::Response

Responses given by the service.
Source§

type Error = <S as Service<ClientContext, Request<B>>>::Error

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ClientContext, req: Request<B>, ) -> Result<Self::Response, Self::Error>

Available on crate feature service_send only.
Process the request and return the response asynchronously.
Source§

impl<LB, D, S, B> Service<ClientContext, Request<B>> for LoadBalanceService<LB, D, S>
where LB: LoadBalance<D>, D: Discover, S: Service<ClientContext, Request<B>, Error = ClientError> + Send + Sync, B: Send,

Source§

type Response = <S as Service<ClientContext, Request<B>>>::Response

Responses given by the service.
Source§

type Error = <S as Service<ClientContext, Request<B>>>::Error

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ClientContext, req: Request<B>, ) -> Result<Self::Response, Self::Error>

Available on crate feature service_send only.
Process the request and return the response asynchronously.
Source§

impl<ReqBody, RespBody> Service<ClientContext, Request<ReqBody>> for Client<ReqBody, RespBody>
where ReqBody: Send,

Source§

type Response = Response<RespBody>

Responses given by the service.
Source§

type Error = ClientError

Errors produced by the service.
Source§

fn call( &self, cx: &mut ClientContext, req: Request<ReqBody>, ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send

Available on crate feature service_send only.
Process the request and return the response asynchronously.
Source§

impl<S, ReqBody, RespBody> Service<ClientContext, Request<ReqBody>> for CookieService<S>
where S: Service<ClientContext, Request<ReqBody>, Response = Response<RespBody>, Error = ClientError> + Send + Sync + 'static, ReqBody: Send, RespBody: Send,

Available on crate feature cookie only.
Source§

type Response = <S as Service<ClientContext, Request<ReqBody>>>::Response

Responses given by the service.
Source§

type Error = <S as Service<ClientContext, Request<ReqBody>>>::Error

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ClientContext, req: Request<ReqBody>, ) -> Result<Self::Response, Self::Error>

Available on crate feature service_send only.
Process the request and return the response asynchronously.

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more