pub struct FleetRouting { /* private fields */ }Expand description
Implements a client for the Cloud Optimization API.
§Example
let client = FleetRouting::builder().build().await?;
// use `client` to make requests to the Cloud Optimization API.§Service 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.
§Configuration
To configure FleetRouting use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://cloudoptimization.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
FleetRouting holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap FleetRouting in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl FleetRouting
impl FleetRouting
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for FleetRouting.
let client = FleetRouting::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: FleetRouting + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: FleetRouting + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn optimize_tours(&self) -> OptimizeTours
pub fn optimize_tours(&self) -> OptimizeTours
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 fn batch_optimize_tours(&self) -> BatchOptimizeTours
pub fn batch_optimize_tours(&self) -> BatchOptimizeTours
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for FleetRouting
impl Clone for FleetRouting
Source§fn clone(&self) -> FleetRouting
fn clone(&self) -> FleetRouting
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more