RouteGuideServer

Struct RouteGuideServer 

Source
pub struct RouteGuideServer<T> { /* private fields */ }
Available on crate feature example_generated only.

Implementations§

Source§

impl<T> RouteGuideServer<T>

Source

pub fn new(service: T) -> Self

Create a new GRPC server

Source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Set the compression encoding for sending

Source

pub fn accept_compressed( self, encodings: impl Into<Arc<[CompressionEncoding]>>, ) -> Self

Set the compression encodings for accepting

Trait Implementations§

Source§

impl<T> Clone for RouteGuideServer<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: RouteGuide> IntoEndpoint for RouteGuideServer<T>

Source§

type Endpoint = Box<dyn DynEndpoint<Output = Response>>

Represents the endpoint type.
Source§

fn into_endpoint(self) -> Self::Endpoint

Converts this object into endpoint.
Source§

impl<T: RouteGuide> Service for RouteGuideServer<T>

Source§

const NAME: &'static str = "routeguide.RouteGuide"

The name of the GRPC service

Auto Trait Implementations§

§

impl<T> Freeze for RouteGuideServer<T>

§

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

§

impl<T> Send for RouteGuideServer<T>
where T: Sync + Send,

§

impl<T> Sync for RouteGuideServer<T>
where T: Sync + Send,

§

impl<T> Unpin for RouteGuideServer<T>

§

impl<T> UnwindSafe for RouteGuideServer<T>
where T: RefUnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EndpointExt for T
where T: IntoEndpoint,

Source§

fn boxed<'a>( self, ) -> Box<dyn DynEndpoint<Output = <Self::Endpoint as Endpoint>::Output> + 'a>
where Self: Sized + 'a,

Wrap the endpoint in a Box.
Source§

fn with<T>(self, middleware: T) -> <T as Middleware<Self::Endpoint>>::Output
where T: Middleware<Self::Endpoint>, Self: Sized,

Use middleware to transform this endpoint. Read more
Source§

fn with_if<T>( self, enable: bool, middleware: T, ) -> EitherEndpoint<Self, <T as Middleware<Self::Endpoint>>::Output>
where T: Middleware<Self::Endpoint>, Self: Sized,

if enable is true then use middleware to transform this endpoint. Read more
Source§

fn data<T>(self, data: T) -> AddDataEndpoint<Self::Endpoint, T>
where T: Clone + Send + Sync + 'static, Self: Sized,

Attach a state data to the endpoint, similar to with(AddData(T)). Read more
Source§

fn data_opt<T>( self, data: Option<T>, ) -> EitherEndpoint<AddDataEndpoint<Self::Endpoint, T>, Self>
where T: Clone + Send + Sync + 'static, Self: Sized,

if data is Some(T) then attach the value to the endpoint.
Source§

fn before<F, Fut>(self, f: F) -> Before<Self, F>
where F: Fn(Request) -> Fut + Send + Sync, Fut: Future<Output = Result<Request, Error>> + Send, Self: Sized,

Maps the request of this endpoint. Read more
Source§

fn after<F, Fut, T>(self, f: F) -> After<Self::Endpoint, F>
where F: Fn(Result<<Self::Endpoint as Endpoint>::Output, Error>) -> Fut + Send + Sync, Fut: Future<Output = Result<T, Error>> + Send, T: IntoResponse, Self: Sized,

Maps the output of this endpoint. Read more
Source§

fn around<F, Fut, R>(self, f: F) -> Around<Self::Endpoint, F>
where F: Fn(Arc<Self::Endpoint>, Request) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, Error>> + Send + 'static, R: IntoResponse, Self: Sized,

Maps the request and response of this endpoint. Read more
Source§

fn map_to_response(self) -> MapToResponse<Self::Endpoint>
where Self: Sized,

Convert the output of this endpoint into a response. Response. Read more
Source§

fn to_response(self) -> ToResponse<Self::Endpoint>
where Self: Sized,

Convert the output of this endpoint into a response. Response. Read more
Source§

fn map<F, Fut, R, R2>(self, f: F) -> Map<Self::Endpoint, F>
where F: Fn(R) -> Fut + Send + Sync, Fut: Future<Output = R2> + Send, R: IntoResponse, R2: IntoResponse, Self: Sized, Self::Endpoint: Sized + Endpoint<Output = R>,

Maps the response of this endpoint. Read more
Source§

fn and_then<F, Fut, R, R2>(self, f: F) -> AndThen<Self::Endpoint, F>
where F: Fn(R) -> Fut + Send + Sync, Fut: Future<Output = Result<R2, Error>> + Send, R: IntoResponse, R2: IntoResponse, Self: Sized, Self::Endpoint: Sized + Endpoint<Output = R>,

Calls f if the result is Ok, otherwise returns the Err value of self. Read more
Source§

fn catch_all_error<F, Fut, R>(self, f: F) -> CatchAllError<Self, F, R>
where F: Fn(Error) -> Fut + Send + Sync, Fut: Future<Output = R> + Send, R: IntoResponse + Send, Self: Sized + Sync,

Catch all errors and convert it into a response. Read more
Source§

fn catch_error<F, Fut, R, ErrType>( self, f: F, ) -> CatchError<Self, F, R, ErrType>
where F: Fn(ErrType) -> Fut + Send + Sync, Fut: Future<Output = R> + Send, R: IntoResponse + Send + Sync, ErrType: Error + Send + Sync + 'static, Self: Sized,

Catch the specified type of error and convert it into a response. Read more
Source§

fn inspect_all_err<F>(self, f: F) -> InspectAllError<Self, F>
where F: Fn(&Error) + Send + Sync, Self: Sized,

Does something with each error. Read more
Source§

fn inspect_err<F, ErrType>(self, f: F) -> InspectError<Self, F, ErrType>
where F: Fn(&ErrType) + Send + Sync, ErrType: Error + Send + Sync + 'static, Self: Sized,

Does something with each specified error type. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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