Struct google_api_proto::maps::fleetengine::v1::vehicle_service_client::VehicleServiceClient
source · pub struct VehicleServiceClient<T> { /* private fields */ }
Expand description
Vehicle management service.
Implementations§
source§impl<T> VehicleServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> VehicleServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> VehicleServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn create_vehicle(
&mut self,
request: impl IntoRequest<CreateVehicleRequest>,
) -> Result<Response<Vehicle>, Status>
pub async fn create_vehicle( &mut self, request: impl IntoRequest<CreateVehicleRequest>, ) -> Result<Response<Vehicle>, Status>
Instantiates a new vehicle associated with an on-demand rideshare or
deliveries provider. Each Vehicle
must have a unique vehicle ID.
The following Vehicle
fields are required when creating a Vehicle
:
vehicleState
supportedTripTypes
maximumCapacity
vehicleType
The following Vehicle
fields are ignored when creating a Vehicle
:
name
currentTrips
availableCapacity
current_route_segment
current_route_segment_end_point
current_route_segment_version
current_route_segment_traffic
route
waypoints
waypoints_version
remaining_distance_meters
remaining_time_seconds
eta_to_next_waypoint
navigation_status
All other fields are optional and used if provided.
sourcepub async fn get_vehicle(
&mut self,
request: impl IntoRequest<GetVehicleRequest>,
) -> Result<Response<Vehicle>, Status>
pub async fn get_vehicle( &mut self, request: impl IntoRequest<GetVehicleRequest>, ) -> Result<Response<Vehicle>, Status>
Returns a vehicle from the Fleet Engine.
sourcepub async fn update_vehicle(
&mut self,
request: impl IntoRequest<UpdateVehicleRequest>,
) -> Result<Response<Vehicle>, Status>
pub async fn update_vehicle( &mut self, request: impl IntoRequest<UpdateVehicleRequest>, ) -> Result<Response<Vehicle>, Status>
Writes updated vehicle data to the Fleet Engine.
When updating a Vehicle
, the following fields cannot be updated since
they are managed by the server:
currentTrips
availableCapacity
current_route_segment_version
waypoints_version
The vehicle name
also cannot be updated.
If the attributes
field is updated, all the vehicle’s attributes are
replaced with the attributes provided in the request. If you want to update
only some attributes, see the UpdateVehicleAttributes
method. Likewise,
the waypoints
field can be updated, but must contain all the waypoints
currently on the vehicle, and no other waypoints.
sourcepub async fn update_vehicle_attributes(
&mut self,
request: impl IntoRequest<UpdateVehicleAttributesRequest>,
) -> Result<Response<UpdateVehicleAttributesResponse>, Status>
pub async fn update_vehicle_attributes( &mut self, request: impl IntoRequest<UpdateVehicleAttributesRequest>, ) -> Result<Response<UpdateVehicleAttributesResponse>, Status>
Partially updates a vehicle’s attributes.
Only the attributes mentioned in the request will be updated, other
attributes will NOT be altered. Note: this is different in UpdateVehicle
,
where the whole attributes
field will be replaced by the one in
UpdateVehicleRequest
, attributes not in the request would be removed.
sourcepub async fn list_vehicles(
&mut self,
request: impl IntoRequest<ListVehiclesRequest>,
) -> Result<Response<ListVehiclesResponse>, Status>
pub async fn list_vehicles( &mut self, request: impl IntoRequest<ListVehiclesRequest>, ) -> Result<Response<ListVehiclesResponse>, Status>
Returns a paginated list of vehicles associated with a provider that match the request options.
sourcepub async fn search_vehicles(
&mut self,
request: impl IntoRequest<SearchVehiclesRequest>,
) -> Result<Response<SearchVehiclesResponse>, Status>
pub async fn search_vehicles( &mut self, request: impl IntoRequest<SearchVehiclesRequest>, ) -> Result<Response<SearchVehiclesResponse>, Status>
Returns a list of vehicles that match the request options.
Trait Implementations§
source§impl<T: Clone> Clone for VehicleServiceClient<T>
impl<T: Clone> Clone for VehicleServiceClient<T>
source§fn clone(&self) -> VehicleServiceClient<T>
fn clone(&self) -> VehicleServiceClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for VehicleServiceClient<T>
impl<T> RefUnwindSafe for VehicleServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for VehicleServiceClient<T>where
T: Send,
impl<T> Sync for VehicleServiceClient<T>where
T: Sync,
impl<T> Unpin for VehicleServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for VehicleServiceClient<T>where
T: UnwindSafe,
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