#[non_exhaustive]pub struct Visit {
pub shipment_index: i32,
pub is_pickup: bool,
pub visit_request_index: i32,
pub start_time: Option<Timestamp>,
pub load_demands: HashMap<String, Load>,
pub detour: Option<Duration>,
pub shipment_label: String,
pub visit_label: String,
pub arrival_loads: Vec<CapacityQuantity>,
pub delay_before_start: Option<Delay>,
pub demands: Vec<CapacityQuantity>,
/* private fields */
}Expand description
A visit performed during a route. This visit corresponds to a pickup or a
delivery of a Shipment.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.shipment_index: i32Index of the shipments field in the source
ShipmentModel.
is_pickup: boolIf true the visit corresponds to a pickup of a Shipment. Otherwise, it
corresponds to a delivery.
visit_request_index: i32Index of VisitRequest in either the pickup or delivery field of the
Shipment (see is_pickup).
start_time: Option<Timestamp>Time at which the visit starts. Note that the vehicle may arrive earlier
than this at the visit location. Times are consistent with the
ShipmentModel.
load_demands: HashMap<String, Load>Total visit load demand as the sum of the shipment and the visit request
load_demands. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).
detour: Option<Duration>Extra detour time due to the shipments visited on the route before the visit and to the potential waiting time induced by time windows. If the visit is a delivery, the detour is computed from the corresponding pickup visit and is equal to:
start_time(delivery) - start_time(pickup)
- (duration(pickup) + travel duration from the pickup location
to the delivery location).Otherwise, it is computed from the vehicle start_location and is equal
to:
start_time - vehicle_start_time - travel duration from
the vehicle's `start_location` to the visit.shipment_label: StringCopy of the corresponding Shipment.label, if specified in the
Shipment.
visit_label: StringCopy of the corresponding
VisitRequest.label,
if specified in the VisitRequest.
arrival_loads: Vec<CapacityQuantity>Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
start_load_intervals, end_load_intervals or demands.
Exception: we omit loads for quantity types unconstrained by intervals and that don’t have any non-zero demand on the route.
delay_before_start: Option<Delay>Deprecated: Use ShipmentRoute.Transition.delay_duration instead. Delay occurring before the visit starts.
demands: Vec<CapacityQuantity>Deprecated: Use Visit.load_demands instead.
Implementations§
Source§impl Visit
impl Visit
Sourcepub fn set_shipment_index<T: Into<i32>>(self, v: T) -> Self
pub fn set_shipment_index<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_is_pickup<T: Into<bool>>(self, v: T) -> Self
pub fn set_is_pickup<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_visit_request_index<T: Into<i32>>(self, v: T) -> Self
pub fn set_visit_request_index<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_start_time<T>(self, v: T) -> Self
pub fn set_start_time<T>(self, v: T) -> Self
Sets the value of start_time.
§Example
use wkt::Timestamp;
let x = Visit::new().set_start_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_time.
§Example
use wkt::Timestamp;
let x = Visit::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
let x = Visit::new().set_or_clear_start_time(None::<Timestamp>);Sourcepub fn set_load_demands<T, K, V>(self, v: T) -> Self
pub fn set_load_demands<T, K, V>(self, v: T) -> Self
Sets the value of load_demands.
§Example
use google_cloud_optimization_v1::model::shipment::Load;
let x = Visit::new().set_load_demands([
("key0", Load::default()/* use setters */),
("key1", Load::default()/* use (different) setters */),
]);Sourcepub fn set_detour<T>(self, v: T) -> Self
pub fn set_detour<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_detour<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_detour<T>(self, v: Option<T>) -> Self
Sourcepub fn set_shipment_label<T: Into<String>>(self, v: T) -> Self
pub fn set_shipment_label<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_visit_label<T: Into<String>>(self, v: T) -> Self
pub fn set_visit_label<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_arrival_loads<T, V>(self, v: T) -> Self
👎Deprecated
pub fn set_arrival_loads<T, V>(self, v: T) -> Self
Sets the value of arrival_loads.
§Example
use google_cloud_optimization_v1::model::CapacityQuantity;
let x = Visit::new()
.set_arrival_loads([
CapacityQuantity::default()/* use setters */,
CapacityQuantity::default()/* use (different) setters */,
]);Sourcepub fn set_delay_before_start<T>(self, v: T) -> Self
👎Deprecated
pub fn set_delay_before_start<T>(self, v: T) -> Self
Sets the value of delay_before_start.
§Example
use google_cloud_optimization_v1::model::shipment_route::Delay;
let x = Visit::new().set_delay_before_start(Delay::default()/* use setters */);Sourcepub fn set_or_clear_delay_before_start<T>(self, v: Option<T>) -> Self
👎Deprecated
pub fn set_or_clear_delay_before_start<T>(self, v: Option<T>) -> Self
Sets or clears the value of delay_before_start.
§Example
use google_cloud_optimization_v1::model::shipment_route::Delay;
let x = Visit::new().set_or_clear_delay_before_start(Some(Delay::default()/* use setters */));
let x = Visit::new().set_or_clear_delay_before_start(None::<Delay>);Sourcepub fn set_demands<T, V>(self, v: T) -> Self
👎Deprecated
pub fn set_demands<T, V>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Visit
Auto Trait Implementations§
impl Freeze for Visit
impl RefUnwindSafe for Visit
impl Send for Visit
impl Sync for Visit
impl Unpin for Visit
impl UnsafeUnpin for Visit
impl UnwindSafe for Visit
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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