ServerContext

Struct ServerContext 

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

RPC context of http server

Implementations§

Source§

impl ServerContext

Source

pub fn new(peer: Address) -> Self

Create a new ServerContext with the address of client

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

Source

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

Trait Implementations§

Source§

impl Context for ServerContext

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 ServerContext

Source§

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

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

impl Deref for ServerContext

Source§

type Target = RpcCx<ServerCxInner, Config>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for ServerContext

Source§

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

Mutably dereferences the value.
Source§

impl<S, F, T, Req, R1, R2> Service<ServerContext, Req> for MapResponse<S, F, T, R1, R2>
where S: Service<ServerContext, Req, Response = R1> + Send + Sync, F: for<'r> MiddlewareHandlerMapResponse<'r, T, R1, R2> + Sync, Req: Send,

Source§

type Response = R2

Responses given by the service.
Source§

type Error = <S as Service<ServerContext, Req>>::Error

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ServerContext, req: Req, ) -> Result<Self::Response, Self::Error>

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

impl<S, B> Service<ServerContext, Request<B>> for ClientIpService<S>
where S: Service<ServerContext, Request<B>> + Send + Sync + 'static, B: Send,

Source§

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

Responses given by the service.
Source§

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

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ServerContext, 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<S, F, T, B, B2, E2> Service<ServerContext, Request<B>> for FromFn<S, F, T, B, B2, E2>
where S: Service<ServerContext, Request<B2>, Response = Response, Error = E2> + Clone + Send + Sync + 'static, F: for<'r> MiddlewareHandlerFromFn<'r, T, B, B2, E2> + Sync, B: Send, B2: 'static,

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = Infallible

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ServerContext, 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, E> Service<ServerContext, Request<B>> for MethodRouter<B, E>
where B: Send,

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ServerContext, 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, E> Service<ServerContext, Request<B>> for Route<B, E>

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

fn call( &self, cx: &mut ServerContext, 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, E> Service<ServerContext, Request<B>> for Router<B, E>
where B: Send + 'static, E: 'static,

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

async fn call( &self, cx: &mut ServerContext, 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, E, F> Service<ServerContext, Request<B>> for ServeDir<E, F>
where B: Send, F: Fn(&Path) -> HeaderValue + Sync,

Source§

type Response = Response<Body>

Responses given by the service.
Source§

type Error = E

Errors produced by the service.
Source§

async fn call( &self, _: &mut ServerContext, req: Request<B>, ) -> 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