Struct AsService

Source
pub struct AsService<'a, T>(/* private fields */);
Expand description

Helper when needing to pass a GrpcService to bounds needing Service.

Trait Implementations§

Source§

impl<'a, T: Debug> Debug for AsService<'a, T>

Source§

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

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

impl<'a, T, ReqBody> Service<Request<ReqBody>> for AsService<'a, T>
where T: GrpcService<ReqBody> + 'a,

Source§

type Response = Response<<T as GrpcService<ReqBody>>::ResponseBody>

Responses given by the service.
Source§

type Future = <T as GrpcService<ReqBody>>::Future

The future response value.
Source§

type Error = <T as GrpcService<ReqBody>>::Error

Errors produced by the service.
Source§

fn poll_ready(&mut self) -> Poll<(), Self::Error>

Returns Ready when the service is able to process requests. Read more
Source§

fn call(&mut self, request: Request<ReqBody>) -> Self::Future

Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for AsService<'a, T>

§

impl<'a, T> RefUnwindSafe for AsService<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for AsService<'a, T>
where T: Send,

§

impl<'a, T> Sync for AsService<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for AsService<'a, T>

§

impl<'a, T> !UnwindSafe for AsService<'a, T>

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, ReqBody, ResBody> GrpcService<ReqBody> for T
where T: Service<Request<ReqBody>, Response = Response<ResBody>>, <T as Service<Request<ReqBody>>>::Error: Into<Box<dyn Error + Send + Sync>>, ResBody: Body + Body,

Source§

type ResponseBody = ResBody

Response body type
Source§

type Future = <T as Service<Request<ReqBody>>>::Future

Response future
Source§

type Error = <T as Service<Request<ReqBody>>>::Error

Error type
Source§

fn poll_ready( &mut self, ) -> Result<Async<()>, <T as GrpcService<ReqBody>>::Error>

Poll that this service is ready.
Source§

fn call( &mut self, request: Request<ReqBody>, ) -> <T as GrpcService<ReqBody>>::Future

Call the service.
Source§

fn into_service(self) -> IntoService<Self>
where Self: Sized,

Helper when needing to pass this type to bounds needing Service.
Source§

fn as_service(&mut self) -> AsService<'_, Self>
where Self: Sized,

Helper when needing to pass this type to bounds needing Service.
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.