pub enum RouteDeviation {
NoDeviation,
Deviation {
kind: DeviationKind,
},
}Expand description
Status information that describes whether the user is proceeding according to the route or not.
Note that the name is intentionally a bit generic to allow for expansion of other states. For example, we could conceivably add a “wrong way” status in the future.
Variants§
NoDeviation
The user is proceeding on course within the expected tolerances; everything is normal.
Deviation
The user has deviated from the expected route.
Check the DeviationKind to determine if the user is still on the route polyline
(off the current step but on a future step) or off the route entirely.
Fields
kind: DeviationKindImplementations§
Source§impl RouteDeviation
impl RouteDeviation
Sourcepub fn is_deviated_from_current_step(&self) -> bool
pub fn is_deviated_from_current_step(&self) -> bool
Whether the user is no longer on the current step’s polyline.
This can happen either because the user has moved onto a future step without triggering advance, or because they have left the route entirely. In other words: any deviation from the current step.
Sourcepub fn is_completely_off_route(&self) -> bool
pub fn is_completely_off_route(&self) -> bool
Whether the user has deviated from the route entirely.
This is true when the user is not just deviated from the current step, but also from the route as a whole (they didn’t just take a shortcut).
Trait Implementations§
Source§impl Clone for RouteDeviation
impl Clone for RouteDeviation
Source§fn clone(&self) -> RouteDeviation
fn clone(&self) -> RouteDeviation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> ConvertError<UT> for RouteDeviation
impl<UT> ConvertError<UT> for RouteDeviation
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
impl Copy for RouteDeviation
Source§impl Debug for RouteDeviation
impl Debug for RouteDeviation
Source§impl<'de> Deserialize<'de> for RouteDeviation
impl<'de> Deserialize<'de> for RouteDeviation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<UT> FfiConverter<UT> for RouteDeviation
impl<UT> FfiConverter<UT> for RouteDeviation
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> Lift<UT> for RouteDeviation
impl<UT> Lift<UT> for RouteDeviation
Source§impl<UT> LiftRef<UT> for RouteDeviation
impl<UT> LiftRef<UT> for RouteDeviation
type LiftType = RouteDeviation
Source§impl<UT> LiftReturn<UT> for RouteDeviation
impl<UT> LiftReturn<UT> for RouteDeviation
Source§type ReturnType = <RouteDeviation as Lift<UT>>::FfiType
type ReturnType = <RouteDeviation as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for RouteDeviation
impl<UT> Lower<UT> for RouteDeviation
type FfiType = <RouteDeviation as FfiConverter<UT>>::FfiType
fn lower(obj: Self) -> Self::FfiType
fn write(obj: Self, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for RouteDeviation
impl<UT> LowerError<UT> for RouteDeviation
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for RouteDeviation
impl<UT> LowerReturn<UT> for RouteDeviation
Source§type ReturnType = <RouteDeviation as Lower<UT>>::FfiType
type ReturnType = <RouteDeviation as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl PartialEq for RouteDeviation
impl PartialEq for RouteDeviation
Source§impl Serialize for RouteDeviation
impl Serialize for RouteDeviation
impl StructuralPartialEq for RouteDeviation
Source§impl<UT> TypeId<UT> for RouteDeviation
impl<UT> TypeId<UT> for RouteDeviation
Auto Trait Implementations§
impl Freeze for RouteDeviation
impl RefUnwindSafe for RouteDeviation
impl Send for RouteDeviation
impl Sync for RouteDeviation
impl Unpin for RouteDeviation
impl UnsafeUnpin for RouteDeviation
impl UnwindSafe for RouteDeviation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more