Struct google_api_proto::google::maps::routing::v2::routes_client::RoutesClient
source · pub struct RoutesClient<T> { /* private fields */ }
Expand description
The Routes API.
Implementations§
source§impl<T> RoutesClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> RoutesClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RoutesClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn compute_routes(
&mut self,
request: impl IntoRequest<ComputeRoutesRequest>,
) -> Result<Response<ComputeRoutesResponse>, Status>
pub async fn compute_routes( &mut self, request: impl IntoRequest<ComputeRoutesRequest>, ) -> Result<Response<ComputeRoutesResponse>, Status>
Returns the primary route along with optional alternate routes, given a set of terminal and intermediate waypoints.
NOTE: This method requires that you specify a response field mask in
the input. You can provide the response field mask by using URL parameter
$fields
or fields
, or by using an HTTP/gRPC header X-Goog-FieldMask
(see the available URL parameters and
headers). The value
is a comma separated list of field paths. See detailed documentation about
how to construct the field
paths.
For example, in this method:
- Field mask of all available fields (for manual inspection):
X-Goog-FieldMask: *
- Field mask of Route-level duration, distance, and polyline (an example
production setup):
X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline
Google discourage the use of the wildcard (*
) response field mask, or
specifying the field mask at the top level (routes
), because:
- Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency.
- Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response.
- Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.
sourcepub async fn compute_route_matrix(
&mut self,
request: impl IntoRequest<ComputeRouteMatrixRequest>,
) -> Result<Response<Streaming<RouteMatrixElement>>, Status>
pub async fn compute_route_matrix( &mut self, request: impl IntoRequest<ComputeRouteMatrixRequest>, ) -> Result<Response<Streaming<RouteMatrixElement>>, Status>
Takes in a list of origins and destinations and returns a stream containing route information for each combination of origin and destination.
NOTE: This method requires that you specify a response field mask in
the input. You can provide the response field mask by using the URL
parameter $fields
or fields
, or by using the HTTP/gRPC header
X-Goog-FieldMask
(see the available URL parameters and
headers).
The value is a comma separated list of field paths. See this detailed
documentation about how to construct the field
paths.
For example, in this method:
- Field mask of all available fields (for manual inspection):
X-Goog-FieldMask: *
- Field mask of route durations, distances, element status, condition, and
element indices (an example production setup):
X-Goog-FieldMask: originIndex,destinationIndex,status,condition,distanceMeters,duration
It is critical that you include status
in your field mask as otherwise
all messages will appear to be OK. Google discourages the use of the
wildcard (*
) response field mask, because:
- Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency.
- Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response.
- Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.
Trait Implementations§
source§impl<T: Clone> Clone for RoutesClient<T>
impl<T: Clone> Clone for RoutesClient<T>
source§fn clone(&self) -> RoutesClient<T>
fn clone(&self) -> RoutesClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for RoutesClient<T>
impl<T> RefUnwindSafe for RoutesClient<T>where
T: RefUnwindSafe,
impl<T> Send for RoutesClient<T>where
T: Send,
impl<T> Sync for RoutesClient<T>where
T: Sync,
impl<T> Unpin for RoutesClient<T>where
T: Unpin,
impl<T> UnwindSafe for RoutesClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request