Struct google_api_proto::google::maps::routeoptimization::v1::DistanceLimit
source · pub struct DistanceLimit {
pub max_meters: Option<i64>,
pub soft_max_meters: Option<i64>,
pub cost_per_kilometer_above_soft_max: Option<f64>,
}
Expand description
A limit defining a maximum distance which can be traveled. It can be either hard or soft.
If a soft limit is defined, both soft_max_meters
and
cost_per_kilometer_above_soft_max
must be defined and be nonnegative.
Fields§
§max_meters: Option<i64>
A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.
soft_max_meters: Option<i64>
A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.
If defined soft_max_meters must be less than max_meters and must be nonnegative.
cost_per_kilometer_above_soft_max: Option<f64>
Cost per kilometer incurred if distance is above soft_max_meters
limit.
The additional cost is 0 if the distance is under the limit, otherwise the
formula used to compute the cost is the following:
(distance_meters - soft_max_meters) / 1000.0 *
cost_per_kilometer_above_soft_max.
The cost must be nonnegative.
Implementations§
source§impl DistanceLimit
impl DistanceLimit
sourcepub fn max_meters(&self) -> i64
pub fn max_meters(&self) -> i64
Returns the value of max_meters
, or the default value if max_meters
is unset.
sourcepub fn soft_max_meters(&self) -> i64
pub fn soft_max_meters(&self) -> i64
Returns the value of soft_max_meters
, or the default value if soft_max_meters
is unset.
sourcepub fn cost_per_kilometer_above_soft_max(&self) -> f64
pub fn cost_per_kilometer_above_soft_max(&self) -> f64
Returns the value of cost_per_kilometer_above_soft_max
, or the default value if cost_per_kilometer_above_soft_max
is unset.
Trait Implementations§
source§impl Clone for DistanceLimit
impl Clone for DistanceLimit
source§fn clone(&self) -> DistanceLimit
fn clone(&self) -> DistanceLimit
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DistanceLimit
impl Debug for DistanceLimit
source§impl Default for DistanceLimit
impl Default for DistanceLimit
source§impl Message for DistanceLimit
impl Message for DistanceLimit
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 DistanceLimit
impl PartialEq for DistanceLimit
source§fn eq(&self, other: &DistanceLimit) -> bool
fn eq(&self, other: &DistanceLimit) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for DistanceLimit
impl StructuralPartialEq for DistanceLimit
Auto Trait Implementations§
impl Freeze for DistanceLimit
impl RefUnwindSafe for DistanceLimit
impl Send for DistanceLimit
impl Sync for DistanceLimit
impl Unpin for DistanceLimit
impl UnwindSafe for DistanceLimit
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