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: String

Output only. The unique name for this vehicle. The format is providers/{provider}/vehicles/{vehicle}.

§vehicle_state: i32

The 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: i32

The 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

Deprecated: Use Vehicle.waypoints instead.

§current_route_segment: String

The 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: bool

Indicates 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.

§navigation_status: i32

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

source

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.

source

pub fn set_vehicle_state(&mut self, value: VehicleState)

Sets vehicle_state to the provided enum value.

source

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.

source

pub fn push_supported_trip_types(&mut self, value: TripType)

Appends the provided enum value to supported_trip_types.

source

pub fn navigation_status(&self) -> NavigationStatus

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: NavigationStatus)

Sets navigation_status to the provided enum value.

Trait Implementations§

source§

impl Clone for Vehicle

source§

fn clone(&self) -> Vehicle

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 Vehicle

source§

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

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

impl Default for Vehicle

source§

fn default() -> Self

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

impl Message for Vehicle

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 Vehicle

source§

fn eq(&self, other: &Vehicle) -> 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 Vehicle

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