Struct google_api_proto::google::maps::routes::v1::RouteMatrixElement
source · 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§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
source§fn eq(&self, other: &RouteMatrixElement) -> bool
fn eq(&self, other: &RouteMatrixElement) -> bool
self
and other
values to be equal, and is used
by ==
.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
§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