Struct google_api_proto::maps::fleetengine::v1::Vehicle
source · pub struct Vehicle {Show 22 fields
pub name: String,
pub vehicle_state: i32,
pub supported_trip_types: Vec<i32>,
pub current_trips: Vec<String>,
pub last_location: Option<VehicleLocation>,
pub maximum_capacity: i32,
pub attributes: Vec<VehicleAttribute>,
pub vehicle_type: Option<VehicleType>,
pub license_plate: Option<LicensePlate>,
pub route: Vec<TerminalLocation>,
pub current_route_segment: String,
pub current_route_segment_traffic: Option<TrafficPolylineData>,
pub current_route_segment_version: Option<Timestamp>,
pub current_route_segment_end_point: Option<TripWaypoint>,
pub remaining_distance_meters: Option<i32>,
pub eta_to_first_waypoint: Option<Timestamp>,
pub remaining_time_seconds: Option<i32>,
pub waypoints: Vec<TripWaypoint>,
pub waypoints_version: Option<Timestamp>,
pub back_to_back_enabled: bool,
pub navigation_status: i32,
pub device_settings: Option<DeviceSettings>,
}Expand description
Vehicle metadata.
Fields§
§name: StringOutput only. The unique name for this vehicle.
The format is providers/{provider}/vehicles/{vehicle}.
vehicle_state: i32The vehicle state.
supported_trip_types: Vec<i32>Trip types supported by this vehicle.
current_trips: Vec<String>Output only. List of trip_id’s for trips currently assigned to this
vehicle.
last_location: Option<VehicleLocation>Last reported location of the vehicle.
maximum_capacity: i32The total numbers of riders this vehicle can carry. The driver is not considered in this value. This value must be greater than or equal to one.
attributes: Vec<VehicleAttribute>List of vehicle attributes. A vehicle can have at most 100 attributes, and each attribute must have a unique key.
vehicle_type: Option<VehicleType>Required. The type of this vehicle. Can be used to filter vehicles in
SearchVehicles results. Also influences ETA and route calculations.
license_plate: Option<LicensePlate>License plate information for the vehicle.
route: Vec<TerminalLocation>Deprecated: Use Vehicle.waypoints instead.
current_route_segment: StringThe polyline specifying the route the driver app intends to take to
the next waypoint. This list is also returned in
Trip.current_route_segment for all active trips assigned to the vehicle.
Note: This field is intended only for use by the Driver SDK. Decoding is not yet supported.
current_route_segment_traffic: Option<TrafficPolylineData>Input only. Fleet Engine uses this information to improve journey sharing. Note: This field is intended only for use by the Driver SDK.
current_route_segment_version: Option<Timestamp>Output only. Time when current_route_segment was set. It can be stored by
the client and passed in future GetVehicle requests to prevent returning
routes that haven’t changed.
current_route_segment_end_point: Option<TripWaypoint>The waypoint where current_route_segment ends. This can be supplied by
drivers on UpdateVehicle calls either as a full trip waypoint, a waypoint
LatLng, or as the last LatLng of the current_route_segment. Fleet
Engine will then do its best to interpolate to an actual waypoint if it is
not fully specified. This field is ignored in UpdateVehicle calls unless
current_route_segment is also specified.
remaining_distance_meters: Option<i32>The remaining driving distance for the current_route_segment.
This value is also returned in Trip.remaining_distance_meters for all
active trips assigned to the vehicle. The value is unspecified if the
current_route_segment field is empty.
eta_to_first_waypoint: Option<Timestamp>The ETA to the first entry in the waypoints field. The value is
unspecified if the waypoints field is empty or the
Vehicle.current_route_segment field is empty.
When updating a vehicle, remaining_time_seconds takes precedence over
eta_to_first_waypoint in the same request.
remaining_time_seconds: Option<i32>Input only. The remaining driving time for the current_route_segment. The
value is unspecified if the waypoints field is empty or the
Vehicle.current_route_segment field is empty. This value should match
eta_to_first_waypoint - current_time if all parties are using the same
clock.
When updating a vehicle, remaining_time_seconds takes precedence over
eta_to_first_waypoint in the same request.
waypoints: Vec<TripWaypoint>The remaining waypoints assigned to this Vehicle.
waypoints_version: Option<Timestamp>Output only. Last time the waypoints field was updated. Clients should
cache this value and pass it in GetVehicleRequest to ensure the
waypoints field is only returned if it is updated.
back_to_back_enabled: boolIndicates if the driver accepts back-to-back trips. If true,
SearchVehicles may include the vehicle even if it is currently assigned
to a trip. The default value is false.
The vehicle’s navigation status.
device_settings: Option<DeviceSettings>Input only. Information about settings in the mobile device being used by the driver.
Implementations§
source§impl Vehicle
impl Vehicle
sourcepub fn vehicle_state(&self) -> VehicleState
pub fn vehicle_state(&self) -> VehicleState
Returns the enum value of vehicle_state, or the default if the field is set to an invalid enum value.
sourcepub fn set_vehicle_state(&mut self, value: VehicleState)
pub fn set_vehicle_state(&mut self, value: VehicleState)
Sets vehicle_state to the provided enum value.
sourcepub fn supported_trip_types(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<TripType>>
pub fn supported_trip_types( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<TripType>>
Returns an iterator which yields the valid enum values contained in supported_trip_types.
sourcepub fn push_supported_trip_types(&mut self, value: TripType)
pub fn push_supported_trip_types(&mut self, value: TripType)
Appends the provided enum value to supported_trip_types.
Returns the enum value of navigation_status, or the default if the field is set to an invalid enum value.
Sets navigation_status to the provided enum value.
Trait Implementations§
source§impl Message for Vehicle
impl Message for Vehicle
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 Vehicle
impl PartialEq for Vehicle
impl StructuralPartialEq for Vehicle
Auto Trait Implementations§
impl Freeze for Vehicle
impl RefUnwindSafe for Vehicle
impl Send for Vehicle
impl Sync for Vehicle
impl Unpin for Vehicle
impl UnwindSafe for Vehicle
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