#[non_exhaustive]pub struct TravelStep {
pub duration: Option<Duration>,
pub distance_meters: f64,
pub traffic_info_unavailable: bool,
pub route_polyline: Option<EncodedPolyline>,
/* private fields */
}Expand description
Deprecated: Use
ShipmentRoute.Transition
instead. Travel between each visit along the route: from the vehicle’s
start_location to the first visit’s arrival_location, then from the
first visit’s departure_location to the second visit’s
arrival_location, and so on until the vehicle’s end_location. This
accounts only for the actual travel between visits, not counting the
waiting time, the time spent performing a visit, nor the distance covered
during a visit.
Invariant: travel_steps_size() == visits_size() + 1.
If the vehicle does not have a start_ and/or end_location, the corresponding travel metrics are 0 and/or empty.
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.duration: Option<Duration>Duration of the travel step.
distance_meters: f64Distance traveled during the step.
When traffic is requested via OptimizeToursRequest.consider_road_traffic, and the traffic info couldn’t be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).
route_polyline: Option<EncodedPolyline>The encoded polyline representation of the route followed during the step.
This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.
Implementations§
Source§impl TravelStep
impl TravelStep
Sourcepub fn set_duration<T>(self, v: T) -> Self
pub fn set_duration<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_duration<T>(self, v: Option<T>) -> Self
Sourcepub fn set_distance_meters<T: Into<f64>>(self, v: T) -> Self
pub fn set_distance_meters<T: Into<f64>>(self, v: T) -> Self
Sets the value of traffic_info_unavailable.
§Example
let x = TravelStep::new().set_traffic_info_unavailable(true);Sourcepub fn set_route_polyline<T>(self, v: T) -> Selfwhere
T: Into<EncodedPolyline>,
pub fn set_route_polyline<T>(self, v: T) -> Selfwhere
T: Into<EncodedPolyline>,
Sets the value of route_polyline.
§Example
use google_cloud_optimization_v1::model::shipment_route::EncodedPolyline;
let x = TravelStep::new().set_route_polyline(EncodedPolyline::default()/* use setters */);Sourcepub fn set_or_clear_route_polyline<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncodedPolyline>,
pub fn set_or_clear_route_polyline<T>(self, v: Option<T>) -> Selfwhere
T: Into<EncodedPolyline>,
Sets or clears the value of route_polyline.
§Example
use google_cloud_optimization_v1::model::shipment_route::EncodedPolyline;
let x = TravelStep::new().set_or_clear_route_polyline(Some(EncodedPolyline::default()/* use setters */));
let x = TravelStep::new().set_or_clear_route_polyline(None::<EncodedPolyline>);Trait Implementations§
Source§impl Clone for TravelStep
impl Clone for TravelStep
Source§fn clone(&self) -> TravelStep
fn clone(&self) -> TravelStep
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TravelStep
impl Debug for TravelStep
Source§impl Default for TravelStep
impl Default for TravelStep
Source§fn default() -> TravelStep
fn default() -> TravelStep
Source§impl PartialEq for TravelStep
impl PartialEq for TravelStep
impl StructuralPartialEq for TravelStep
Auto Trait Implementations§
impl Freeze for TravelStep
impl RefUnwindSafe for TravelStep
impl Send for TravelStep
impl Sync for TravelStep
impl Unpin for TravelStep
impl UnsafeUnpin for TravelStep
impl UnwindSafe for TravelStep
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