Struct google_api_proto::maps::fleetengine::delivery::v1::Task

source ·
pub struct Task {
Show 15 fields pub name: String, pub type: i32, pub state: i32, pub task_outcome: i32, pub task_outcome_time: Option<Timestamp>, pub task_outcome_location: Option<LocationInfo>, pub task_outcome_location_source: i32, pub tracking_id: String, pub delivery_vehicle_id: String, pub planned_location: Option<LocationInfo>, pub task_duration: Option<Duration>, pub target_time_window: Option<TimeWindow>, pub journey_sharing_info: Option<JourneySharingInfo>, pub task_tracking_view_config: Option<TaskTrackingViewConfig>, pub attributes: Vec<TaskAttribute>,
}
Expand description

A Task in the Delivery API represents a single action to track. In general, there is a distinction between shipment-related Tasks and break Tasks. A shipment can have multiple Tasks associated with it. For example, there could be one Task for the pickup, and one for the drop-off or transfer. Also, different Tasks for a given shipment can be handled by different vehicles. For example, one vehicle could handle the pickup, driving the shipment to the hub, while another vehicle drives the same shipment from the hub to the drop-off location.

Note: gRPC and REST APIs use different field naming conventions. For example, the Task.journey_sharing_info field in the gRPC API and the Task.journeySharingInfo field in the REST API refer to the same field.

Fields§

§name: String

Must be in the format providers/{provider}/tasks/{task}.

§type: i32

Required. Immutable. Defines the type of the Task. For example, a break or shipment.

§state: i32

Required. The current execution state of the Task.

§task_outcome: i32

The outcome of the Task.

§task_outcome_time: Option<Timestamp>

The timestamp that indicates when the Task’s outcome was set by the provider.

§task_outcome_location: Option<LocationInfo>

The location where the Task’s outcome was set. This value is updated as part of UpdateTask. If this value isn’t explicitly updated by the provider, then Fleet Engine populates it by default with the last known vehicle location (the raw location).

§task_outcome_location_source: i32

Indicates where the value of the task_outcome_location came from.

§tracking_id: String

Immutable. This field facilitates the storing of an ID so you can avoid using a complicated mapping. You cannot set tracking_id for Tasks of type UNAVAILABLE and SCHEDULED_STOP. These IDs are subject to the following restrictions:

  • Must be a valid Unicode string.
  • Limited to a maximum length of 64 characters.
  • Normalized according to [Unicode Normalization Form C] (http://www.unicode.org/reports/tr15/).
  • May not contain any of the following ASCII characters: ‘/’, ‘:’, ‘?’, ‘,’, or ‘#’.
§delivery_vehicle_id: String

Output only. The ID of the vehicle that is executing this Task. Delivery Vehicle IDs are subject to the following restrictions:

  • Must be a valid Unicode string.
  • Limited to a maximum length of 64 characters.
  • Normalized according to [Unicode Normalization Form C] (http://www.unicode.org/reports/tr15/).
  • May not contain any of the following ASCII characters: ‘/’, ‘:’, ‘?’, ‘,’, or ‘#’.
§planned_location: Option<LocationInfo>

Immutable. The location where the Task will be completed. Optional for UNAVAILABLE Tasks, but required for all other Tasks.

§task_duration: Option<Duration>

Required. Immutable. The time needed to execute a Task at this location.

§target_time_window: Option<TimeWindow>

The time window during which the task should be completed.

§journey_sharing_info: Option<JourneySharingInfo>

Output only. Journey sharing-specific fields. Not populated when state is CLOSED.

§task_tracking_view_config: Option<TaskTrackingViewConfig>

The configuration for task tracking that specifies which data elements are visible to the end users under what circumstances.

§attributes: Vec<TaskAttribute>

A list of custom Task attributes. Each attribute must have a unique key.

Implementations§

source§

impl Task

source

pub fn type(&self) -> Type

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

Sets type to the provided enum value.

source

pub fn state(&self) -> State

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

source

pub fn set_state(&mut self, value: State)

Sets state to the provided enum value.

source

pub fn task_outcome(&self) -> TaskOutcome

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

source

pub fn set_task_outcome(&mut self, value: TaskOutcome)

Sets task_outcome to the provided enum value.

source

pub fn task_outcome_location_source(&self) -> TaskOutcomeLocationSource

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

source

pub fn set_task_outcome_location_source( &mut self, value: TaskOutcomeLocationSource, )

Sets task_outcome_location_source to the provided enum value.

Trait Implementations§

source§

impl Clone for Task

source§

fn clone(&self) -> Task

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 Task

source§

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

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

impl Default for Task

source§

fn default() -> Self

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

impl Message for Task

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 Task

source§

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

Auto Trait Implementations§

§

impl Freeze for Task

§

impl RefUnwindSafe for Task

§

impl Send for Task

§

impl Sync for Task

§

impl Unpin for Task

§

impl UnwindSafe for Task

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