pub struct RouteMatrixElement {
pub origin_index: i32,
pub destination_index: i32,
pub status: Option<Status>,
pub condition: i32,
pub distance_meters: i32,
pub duration: Option<Duration>,
pub static_duration: Option<Duration>,
pub travel_advisory: Option<RouteTravelAdvisory>,
pub fallback_info: Option<FallbackInfo>,
}
Expand description
Encapsulates route information computed for an origin/destination pair in the ComputeRouteMatrix API. This proto can be streamed to the client.
Fields§
§origin_index: i32
Zero-based index of the origin in the request.
destination_index: i32
Zero-based index of the destination in the request.
status: Option<Status>
Error status code for this element.
condition: i32
Indicates whether the route was found or not. Independent of status.
distance_meters: i32
The travel distance of the route, in meters.
duration: Option<Duration>
The length of time needed to navigate the route. If you set the
routing_preference
to TRAFFIC_UNAWARE
, then this value is the same as
static_duration
. If you set the routing_preference
to either
TRAFFIC_AWARE
or TRAFFIC_AWARE_OPTIMAL
, then this value is calculated
taking traffic conditions into account.
static_duration: Option<Duration>
The duration of traveling through the route without taking traffic conditions into consideration.
travel_advisory: Option<RouteTravelAdvisory>
Additional information about the route. For example: restriction information and toll information
fallback_info: Option<FallbackInfo>
In some cases when the server is not able to compute the route with the given preferences for this particular origin/destination pair, it may fall back to using a different mode of computation. When fallback mode is used, this field contains detailed information about the fallback response. Otherwise this field is unset.
Implementations§
Source§impl RouteMatrixElement
impl RouteMatrixElement
Sourcepub fn condition(&self) -> RouteMatrixElementCondition
pub fn condition(&self) -> RouteMatrixElementCondition
Returns the enum value of condition
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_condition(&mut self, value: RouteMatrixElementCondition)
pub fn set_condition(&mut self, value: RouteMatrixElementCondition)
Sets condition
to the provided enum value.
Trait Implementations§
Source§impl Clone for RouteMatrixElement
impl Clone for RouteMatrixElement
Source§fn clone(&self) -> RouteMatrixElement
fn clone(&self) -> RouteMatrixElement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RouteMatrixElement
impl Debug for RouteMatrixElement
Source§impl Default for RouteMatrixElement
impl Default for RouteMatrixElement
Source§fn default() -> RouteMatrixElement
fn default() -> RouteMatrixElement
Source§impl Message for RouteMatrixElement
impl Message for RouteMatrixElement
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for RouteMatrixElement
impl PartialEq for RouteMatrixElement
impl StructuralPartialEq for RouteMatrixElement
Auto Trait Implementations§
impl Freeze for RouteMatrixElement
impl RefUnwindSafe for RouteMatrixElement
impl Send for RouteMatrixElement
impl Sync for RouteMatrixElement
impl Unpin for RouteMatrixElement
impl UnwindSafe for RouteMatrixElement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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