Struct google_api_proto::google::maps::routes::v1alpha::routes_alpha_client::RoutesAlphaClient
source · pub struct RoutesAlphaClient<T> { /* private fields */ }
Expand description
The Routes Preferred API.
Implementations§
source§impl<T> RoutesAlphaClient<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> RoutesAlphaClient<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,
) -> RoutesAlphaClient<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 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-level duration, distance, and polyline (an example
production setup):
X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline
Google discourages 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.
sourcepub async fn compute_custom_routes(
&mut self,
request: impl IntoRequest<ComputeCustomRoutesRequest>,
) -> Result<Response<ComputeCustomRoutesResponse>, Status>
pub async fn compute_custom_routes( &mut self, request: impl IntoRequest<ComputeCustomRoutesRequest>, ) -> Result<Response<ComputeCustomRoutesResponse>, Status>
Given a set of terminal and intermediate waypoints, and a route objective, computes the best route for the route objective. Also returns fastest route and shortest route as reference routes.
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 distances, durations, token and toll info:
X-Goog-FieldMask: routes.route.distanceMeters,routes.route.duration,routes.token,routes.route.travelAdvisory.tollInfo
Google discourages 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.
Trait Implementations§
source§impl<T: Clone> Clone for RoutesAlphaClient<T>
impl<T: Clone> Clone for RoutesAlphaClient<T>
source§fn clone(&self) -> RoutesAlphaClient<T>
fn clone(&self) -> RoutesAlphaClient<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 RoutesAlphaClient<T>
impl<T> RefUnwindSafe for RoutesAlphaClient<T>where
T: RefUnwindSafe,
impl<T> Send for RoutesAlphaClient<T>where
T: Send,
impl<T> Sync for RoutesAlphaClient<T>where
T: Sync,
impl<T> Unpin for RoutesAlphaClient<T>where
T: Unpin,
impl<T> UnwindSafe for RoutesAlphaClient<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