[−][src]Struct ament_rs::ament::Ament
Stores a list of prefixes in which resources will be searched.
Fields
prefixes: Vec<String>
The list of prefixes in which resources will be searched.
Methods
impl Ament
[src]
pub fn new() -> Result<Self, VarError>
[src]
Constructs a new Ament
struct with prefixes read from the AMENT_PREFIX_PATH
environment variable.
Errors
A std::env::VarError
is returned if the AMENT_PREFIX_PATH
environment variable is not set.
pub fn from_var(env_var: impl AsRef<str>) -> Result<Self, VarError>
[src]
Constructs a new Ament
struct with prefixes read from the given environment variable.
Errors
A std::env::VarError
is returned if the given environment variable is not set.
pub fn get_packages_prefix(&self) -> HashMap<String, String>
[src]
Returns a map containing packages name for key and the first prefix in which each package was found for value.
pub fn get_packages_prefixes(&self) -> HashMap<String, Vec<String>>
[src]
Returns a map containing packages name for key and the list of prefixes in which each package was found for value.
pub fn get_package_share_directory(
&self,
package_name: impl AsRef<str>
) -> Option<PathBuf>
[src]
&self,
package_name: impl AsRef<str>
) -> Option<PathBuf>
Returns the share
directory of the package or None
is the package was not found.
pub fn find_package(&self, package_name: impl AsRef<str>) -> Option<String>
[src]
Returns the prefix in which the given package has been found or None
if the package has not been found.
pub fn has_package(&self, package_name: impl AsRef<str>) -> bool
[src]
Returns true if the given package exists in the ament resource index, returns false otherwise.
pub fn get_resource(
&self,
resource_name: impl AsRef<str>,
resource_type: impl AsRef<str>
) -> Option<(Result<Vec<u8>>, String)>
[src]
&self,
resource_name: impl AsRef<str>,
resource_type: impl AsRef<str>
) -> Option<(Result<Vec<u8>>, String)>
Returns the content of the resource if the given resource exists in the ament resource index, or None
if the resource was not found.
pub fn get_resources_prefix(
&self,
resource_type: impl AsRef<str>
) -> HashMap<String, String>
[src]
&self,
resource_type: impl AsRef<str>
) -> HashMap<String, String>
Returns a map containing resources name for key and the first prefix in which each resource was found for value.
pub fn get_resources_prefixes(
&self,
resource_type: impl AsRef<str>
) -> HashMap<String, Vec<String>>
[src]
&self,
resource_type: impl AsRef<str>
) -> HashMap<String, Vec<String>>
Returns a map containing resources name for key and the list of prefixes in which each resource was found for value.
pub fn find_resource(
&self,
resource_name: impl AsRef<str>,
resource_type: impl AsRef<str>
) -> Option<String>
[src]
&self,
resource_name: impl AsRef<str>,
resource_type: impl AsRef<str>
) -> Option<String>
Returns the prefix in which the given resource was found or None
if the resource was not found.
pub fn has_resource(
&self,
resource_name: impl AsRef<str>,
resource_type: impl AsRef<str>
) -> bool
[src]
&self,
resource_name: impl AsRef<str>,
resource_type: impl AsRef<str>
) -> bool
Returns true if the given resource exists in the ament resource index, returns false otherwise.
Trait Implementations
impl PartialEq<Ament> for Ament
[src]
impl Clone for Ament
[src]
fn clone(&self) -> Ament
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Ament
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,