Skip to main content

CatalogLoader

Struct CatalogLoader 

Source
pub struct CatalogLoader { /* private fields */ }
Expand description

Catalog file loader that handles file system operations

Implementations§

Source§

impl CatalogLoader

Source

pub fn new() -> Self

Create a new catalog loader

Source

pub fn with_base_path<P: AsRef<Path>>(base_path: P) -> Self

Create a catalog loader with a specific base path

Source

pub fn set_base_path<P: AsRef<Path>>(&mut self, base_path: P)

Set the base path for resolving relative paths

Source

pub fn discover_catalog_files( &self, directory: &Directory, ) -> Result<Vec<PathBuf>>

Discover all .xosc files in a directory

Source

pub fn load_catalog_file<P: AsRef<Path>>(&self, file_path: P) -> Result<String>

Load and parse a catalog file

Source

pub fn load_and_parse_catalog_file<P: AsRef<Path>>( &self, file_path: P, ) -> Result<CatalogFile>

Load and parse a catalog file into a CatalogFile structure

Source

pub fn parse_catalog_from_string(&self, xml: &str) -> Result<CatalogFile>

Load and parse a catalog from XML string

Source

pub fn load_vehicle_catalogs( &self, directory: &Directory, ) -> Result<Vec<CatalogVehicle>>

Load all vehicle catalogs from a directory

Source

pub fn load_controller_catalogs( &self, directory: &Directory, ) -> Result<Vec<CatalogController>>

Load all controller catalogs from a directory

Source

pub fn load_pedestrian_catalogs( &self, directory: &Directory, ) -> Result<Vec<CatalogPedestrian>>

Load all pedestrian catalogs from a directory

Source

pub fn find_entity_in_catalog<P: AsRef<Path>>( &self, file_path: P, entity_name: &str, ) -> Result<Option<String>>

Find a specific entity in a catalog file

Source

pub fn load_controller_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<ControllerCatalog>

Load a specific controller catalog from a file

Source

pub fn load_trajectory_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<TrajectoryCatalog>

Load a specific trajectory catalog from a file

Source

pub fn load_route_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<RouteCatalog>

Load a specific route catalog from a file

Source

pub fn load_environment_catalog<P: AsRef<Path>>( &self, file_path: P, ) -> Result<EnvironmentCatalog>

Load a specific environment catalog from a file

Source

pub fn load_controller_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, ControllerCatalog>>

Load all controller catalogs from a directory and return them as a hashmap

Source

pub fn load_trajectory_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, TrajectoryCatalog>>

Load all trajectory catalogs from a directory and return them as a hashmap

Source

pub fn load_route_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, RouteCatalog>>

Load all route catalogs from a directory and return them as a hashmap

Source

pub fn load_environment_catalogs_from_directory( &self, directory: &Directory, ) -> Result<HashMap<String, EnvironmentCatalog>>

Load all environment catalogs from a directory and return them as a hashmap

Trait Implementations§

Source§

impl Default for CatalogLoader

Source§

fn default() -> Self

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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