pub struct ResourceManager { /* private fields */ }
Expand description
§ResourceManager
Convenient method for getting the path to the resources of the backends.
§Backends
- maliput_malidrive: Resources from maliput_malidrive are brought by maliput-sdk package. All the maliput_malidrive resources are stored in the same directory: (See https://github.com/maliput/maliput_malidrive/tree/main/resources)
§Example
How to get all the resources from the maliput_malidrive backend:
let resource_manager = maliput::ResourceManager::new();
let all_resources_in_malidrive = resource_manager.get_all_resources_by_backend("maliput_malidrive");
How to get the path to the TShapeRoad.xodr file from the maliput_malidrive backend:
let resource_manager = maliput::ResourceManager::new();
let t_shape_road_xodr_path = resource_manager.get_resource_path_by_name("maliput_malidrive", "TShapeRoad.xodr");
assert!(t_shape_road_xodr_path.is_some());
assert!(t_shape_road_xodr_path.unwrap().exists());
Implementations§
Source§impl ResourceManager
impl ResourceManager
Sourcepub fn new() -> ResourceManager
pub fn new() -> ResourceManager
Creates a new ResourceManager.
Sourcepub fn get_resource_path_by_name(
&self,
backend_name: &str,
resource_name: &str,
) -> Option<PathBuf>
pub fn get_resource_path_by_name( &self, backend_name: &str, resource_name: &str, ) -> Option<PathBuf>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceManager
impl RefUnwindSafe for ResourceManager
impl Send for ResourceManager
impl Sync for ResourceManager
impl Unpin for ResourceManager
impl UnwindSafe for ResourceManager
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