pub struct DeliveryVehicle {
    pub name: String,
    pub last_location: Option<DeliveryVehicleLocation>,
    pub navigation_status: i32,
    pub current_route_segment: Bytes,
    pub current_route_segment_end_point: Option<LatLng>,
    pub remaining_distance_meters: Option<i32>,
    pub remaining_duration: Option<Duration>,
    pub remaining_vehicle_journey_segments: Vec<VehicleJourneySegment>,
    pub attributes: Vec<DeliveryVehicleAttribute>,
    pub type: i32,
}
Expand description

The DeliveryVehicle message. A delivery vehicle transports shipments from a depot to a delivery location, and from a pickup location to the depot. In some cases, delivery vehicles also transport shipments directly from the pickup location to the delivery location.

Note: gRPC and REST APIs use different field naming conventions. For example, the DeliveryVehicle.current_route_segment field in the gRPC API and the DeliveryVehicle.currentRouteSegment field in the REST API refer to the same field.

Fields§

§name: String

The unique name of this Delivery Vehicle. The format is providers/{provider}/deliveryVehicles/{vehicle}.

§last_location: Option<DeliveryVehicleLocation>

The last reported location of the Delivery Vehicle.

§navigation_status: i32

The Delivery Vehicle’s navigation status.

§current_route_segment: Bytes

The encoded polyline specifying the route that the navigation recommends taking to the next waypoint. Your driver app updates this when a stop is reached or passed, and when the navigation reroutes. These LatLngs are returned in Task.journey_sharing_info.remaining_vehicle_journey_segments\[0\].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments\[0\].path (REST) for all active Tasks assigned to the Vehicle.

There are a few cases where this field might not be used to populate Task.journey_sharing_info.remaining_vehicle_journey_segments\[0\].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments\[0\].path (REST):

  • The endpoint of the current_route_segment does not match DeliveryVehicle.remaining_vehicle_journey_segments\[0\].stop (gRPC) or DeliveryVehicle.remainingVehicleJourneySegments\[0\].stop (REST).

  • The driver app has not updated its location recently, so the last updated value for this field might be stale.

  • The driver app has recently updated its location, but the current_route_segment is stale, and points to a previous vehicle stop.

In these cases, Fleet Engine populates this field with a route from the most recently passed VehicleStop to the upcoming VehicleStop to ensure that the consumer of this field has the best available information on the current path of the Delivery Vehicle.

§current_route_segment_end_point: Option<LatLng>

The location where the current_route_segment ends. This is not currently populated by the driver app, but you can supply it on UpdateDeliveryVehicle calls. It is either the LatLng from the upcoming vehicle stop, or the last LatLng of the current_route_segment. Fleet Engine will then do its best to interpolate to an actual VehicleStop.

This field is ignored in UpdateDeliveryVehicle calls if the current_route_segment field is empty.

§remaining_distance_meters: Option<i32>

The remaining driving distance for the current_route_segment. The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. This field is returned in Task.remaining_vehicle_journey_segments\[0\].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments\[0\].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle.

Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

§remaining_duration: Option<Duration>

The remaining driving time for the current_route_segment. The Driver app typically provides this field, but there are some circumstances in which Fleet Engine will override the value sent by the app. For more information, see [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. This field is returned in Task.remaining_vehicle_journey_segments\[0\].driving_duration (gRPC) or Task.remainingVehicleJourneySegments\[0\].drivingDuration (REST) for all active tasks assigned to the Delivery Vehicle.

Fleet Engine ignores this field in UpdateDeliveryVehicleRequest if the current_route_segment field is empty.

§remaining_vehicle_journey_segments: Vec<VehicleJourneySegment>

The journey segments assigned to this Delivery Vehicle, starting from the Vehicle’s most recently reported location. This field won’t be populated in the response of ListDeliveryVehicles.

§attributes: Vec<DeliveryVehicleAttribute>

A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have at most 100 attributes, and each attribute must have a unique key.

§type: i32

The type of this delivery vehicle. If unset, this will default to AUTO.

Implementations§

source§

impl DeliveryVehicle

source

pub fn navigation_status(&self) -> DeliveryVehicleNavigationStatus

Returns the enum value of navigation_status, or the default if the field is set to an invalid enum value.

source

pub fn set_navigation_status(&mut self, value: DeliveryVehicleNavigationStatus)

Sets navigation_status to the provided enum value.

source

pub fn type(&self) -> DeliveryVehicleType

Returns the enum value of type, or the default if the field is set to an invalid enum value.

source

pub fn set_type(&mut self, value: DeliveryVehicleType)

Sets type to the provided enum value.

Trait Implementations§

source§

impl Clone for DeliveryVehicle

source§

fn clone(&self) -> DeliveryVehicle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DeliveryVehicle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DeliveryVehicle

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for DeliveryVehicle

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for DeliveryVehicle

source§

fn eq(&self, other: &DeliveryVehicle) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for DeliveryVehicle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more