pub struct PathResult {
pub path: Option<TrainPath>,
pub mode: PathCalculationMode,
pub projected_positions: Vec<ProjectedPosition>,
pub warnings: Vec<String>,
pub debug_info: Option<DebugInfo>,
}Expand description
Result of train path calculation
Contains the calculated path (if any), mode used, projected positions, and any warnings encountered during calculation.
Fields§
§path: Option<TrainPath>The calculated path, None if calculation failed
mode: PathCalculationModeMode used for calculation
projected_positions: Vec<ProjectedPosition>Projected GNSS positions onto the path
warnings: Vec<String>Warnings encountered during calculation
debug_info: Option<DebugInfo>Debug information collected during calculation (only populated when debug_mode=true)
Implementations§
Source§impl PathResult
impl PathResult
Sourcepub fn new(
path: Option<TrainPath>,
mode: PathCalculationMode,
projected_positions: Vec<ProjectedPosition>,
warnings: Vec<String>,
) -> Self
pub fn new( path: Option<TrainPath>, mode: PathCalculationMode, projected_positions: Vec<ProjectedPosition>, warnings: Vec<String>, ) -> Self
Create a new path result
Sourcepub fn with_debug_info(
path: Option<TrainPath>,
mode: PathCalculationMode,
projected_positions: Vec<ProjectedPosition>,
warnings: Vec<String>,
debug_info: DebugInfo,
) -> Self
pub fn with_debug_info( path: Option<TrainPath>, mode: PathCalculationMode, projected_positions: Vec<ProjectedPosition>, warnings: Vec<String>, debug_info: DebugInfo, ) -> Self
Create a new path result with debug info
Sourcepub fn has_debug_info(&self) -> bool
pub fn has_debug_info(&self) -> bool
Check if debug info is available
Sourcepub fn is_topology_based(&self) -> bool
pub fn is_topology_based(&self) -> bool
Check if topology-based calculation was used
Sourcepub fn is_fallback(&self) -> bool
pub fn is_fallback(&self) -> bool
Check if fallback mode was used
Trait Implementations§
Source§impl Clone for PathResult
impl Clone for PathResult
Source§fn clone(&self) -> PathResult
fn clone(&self) -> PathResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathResult
impl Debug for PathResult
Source§impl<'de> Deserialize<'de> for PathResult
impl<'de> Deserialize<'de> for PathResult
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PathResult
impl RefUnwindSafe for PathResult
impl Send for PathResult
impl Sync for PathResult
impl Unpin for PathResult
impl UnsafeUnpin for PathResult
impl UnwindSafe for PathResult
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>
Converts
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>
Converts
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