Struct IntoService

Source
pub struct IntoService<T>(/* private fields */);
Expand description

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

Trait Implementations§

Source§

impl<T: Debug> Debug for IntoService<T>

Source§

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

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

impl<T, ReqBody> Service<Request<ReqBody>> for IntoService<T>
where T: GrpcService<ReqBody>,

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<T> Freeze for IntoService<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for IntoService<T>
where T: RefUnwindSafe,

§

impl<T> Send for IntoService<T>
where T: Send,

§

impl<T> Sync for IntoService<T>
where T: Sync,

§

impl<T> Unpin for IntoService<T>
where T: Unpin,

§

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