Struct google_api_proto::google::maps::routeoptimization::v1::route_optimization_client::RouteOptimizationClient
source · pub struct RouteOptimizationClient<T> { /* private fields */ }Expand description
A service for optimizing vehicle tours.
Validity of certain types of fields:
google.protobuf.Timestamp- Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
- seconds must be in [0, 253402300799], i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
- nanos must be unset or set to 0.
google.protobuf.Duration- seconds must be in [0, 253402300799], i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
- nanos must be unset or set to 0.
google.type.LatLng- latitude must be in [-90.0, 90.0].
- longitude must be in [-180.0, 180.0].
- at least one of latitude and longitude must be non-zero.
Implementations§
source§impl<T> RouteOptimizationClient<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> RouteOptimizationClient<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,
) -> RouteOptimizationClient<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 optimize_tours(
&mut self,
request: impl IntoRequest<OptimizeToursRequest>,
) -> Result<Response<OptimizeToursResponse>, Status>
pub async fn optimize_tours( &mut self, request: impl IntoRequest<OptimizeToursRequest>, ) -> Result<Response<OptimizeToursResponse>, Status>
Sends an OptimizeToursRequest containing a ShipmentModel and returns an
OptimizeToursResponse containing ShipmentRoutes, which are a set of
routes to be performed by vehicles minimizing the overall cost.
A ShipmentModel model consists mainly of Shipments that need to be
carried out and Vehicles that can be used to transport the Shipments.
The ShipmentRoutes assign Shipments to Vehicles. More specifically,
they assign a series of Visits to each vehicle, where a Visit
corresponds to a VisitRequest, which is a pickup or delivery for a
Shipment.
The goal is to provide an assignment of ShipmentRoutes to Vehicles that
minimizes the total cost where cost has many components defined in the
ShipmentModel.
sourcepub async fn batch_optimize_tours(
&mut self,
request: impl IntoRequest<BatchOptimizeToursRequest>,
) -> Result<Response<Operation>, Status>
pub async fn batch_optimize_tours( &mut self, request: impl IntoRequest<BatchOptimizeToursRequest>, ) -> Result<Response<Operation>, Status>
Optimizes vehicle tours for one or more OptimizeToursRequest
messages as a batch.
This method is a Long Running Operation (LRO). The inputs for optimization
(OptimizeToursRequest messages) and outputs (OptimizeToursResponse
messages) are read/written from/to Cloud Storage in user-specified
format. Like the OptimizeTours method, each OptimizeToursRequest
contains a ShipmentModel and returns an OptimizeToursResponse
containing ShipmentRoutes, which are a set of routes to be performed by
vehicles minimizing the overall cost.
Trait Implementations§
source§impl<T: Clone> Clone for RouteOptimizationClient<T>
impl<T: Clone> Clone for RouteOptimizationClient<T>
source§fn clone(&self) -> RouteOptimizationClient<T>
fn clone(&self) -> RouteOptimizationClient<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 RouteOptimizationClient<T>
impl<T> RefUnwindSafe for RouteOptimizationClient<T>where
T: RefUnwindSafe,
impl<T> Send for RouteOptimizationClient<T>where
T: Send,
impl<T> Sync for RouteOptimizationClient<T>where
T: Sync,
impl<T> Unpin for RouteOptimizationClient<T>where
T: Unpin,
impl<T> UnwindSafe for RouteOptimizationClient<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