Skip to main content

LuaTrainManagerRequestTrainPathParams

Struct LuaTrainManagerRequestTrainPathParams 

Source
pub struct LuaTrainManagerRequestTrainPathParams {
    pub goals: Vec<LuaAny>,
    pub in_chain_signal_section: bool,
    pub return_path: bool,
    pub search_direction: LuaTrainManagerSearchDirection,
    pub shortest_path: bool,
    pub starts: Vec<RailEndStart>,
    pub steps_limit: u32,
    pub train: LuaTrain,
    pub type: TrainPathRequestType,
}
Expand description

Direct access to train pathfinder. Allows to search rail paths or querying which stops are accessible

Fields§

§goals: Vec<LuaAny>§in_chain_signal_section: bool

Defaults to false. If set to true, pathfinder will not return a path that cannot have its start immediately reserved. A path that cannot have its start immediately reserved could cause a train to stop inside of an intersection.

§return_path: bool

Only relevant if request type is "path". Returning a full path is expensive due to multiple LuaEntity created. In order for path to be returned, true must be provided here. Defaults to false in which case a path will not be provided.

§search_direction: LuaTrainManagerSearchDirection

Only relevant if starts was not provided in which case 2 starts (front and back) are deduced from the train. Selects which train ends should be considered as starts. Defaults to "any-direction-with-locomotives".

§shortest_path: bool

Defaults to false. If set to true, only length of rails is added to penalties causing search to look for shortest path (not smallest penalty)

§starts: Vec<RailEndStart>

Manually provided starting positions.

§steps_limit: u32

Maximum amount of steps pathfinder is allowed to perform.

§train: LuaTrain

Mandatory if starts is not provided, optional otherwise. Selects a context for the pathfinder to decide which train to exclude from penalties and which signals are considered possible to reacquire. If starts is not provided, then it is also used to collect front and back ends for the search

§type: TrainPathRequestType

Request type. Determines the return type of the method. Defaults to "path".

Trait Implementations§

Source§

impl Clone for LuaTrainManagerRequestTrainPathParams

Source§

fn clone(&self) -> LuaTrainManagerRequestTrainPathParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LuaTrainManagerRequestTrainPathParams

Source§

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

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

impl Default for LuaTrainManagerRequestTrainPathParams

Source§

fn default() -> LuaTrainManagerRequestTrainPathParams

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

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

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>,

Source§

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.