Struct zenoh_util::LibLoader
source · pub struct LibLoader { /* private fields */ }
Expand description
LibLoader allows search for librairies and to load them.
Implementations§
source§impl LibLoader
impl LibLoader
sourcepub fn default_search_paths() -> &'static str
pub fn default_search_paths() -> &'static str
Returns the list of search paths used by LibLoader::default()
sourcepub fn new<S>(search_dirs: &[S], exe_parent_dir: bool) -> LibLoaderwhere
S: AsRef<str>,
pub fn new<S>(search_dirs: &[S], exe_parent_dir: bool) -> LibLoaderwhere S: AsRef<str>,
Creates a new LibLoader with a set of paths where the libraries will be searched for.
If exe_parent_dir
is true, the parent directory of the current executable is also added
to the set of paths for search.
sourcepub fn search_paths(&self) -> &[PathBuf]
pub fn search_paths(&self) -> &[PathBuf]
Return the list of search paths used by this LibLoader
sourcepub unsafe fn load_file(path: &str) -> ZResult<(Library, PathBuf)>
pub unsafe fn load_file(path: &str) -> ZResult<(Library, PathBuf)>
Load a library from the specified path.
Safety
This function calls libloading::Library::new() which is unsafe.
sourcepub unsafe fn search_and_load(&self, name: &str) -> ZResult<(Library, PathBuf)>
pub unsafe fn search_and_load(&self, name: &str) -> ZResult<(Library, PathBuf)>
Search for library with filename: LIB_PREFIX+name
+LIB_SUFFIX and load it.
The result is a tuple with:
- the Library
- its full path
Safety
This function calls libloading::Library::new() which is unsafe.
sourcepub unsafe fn load_all_with_prefix(
&self,
prefix: Option<&str>
) -> Vec<(Library, PathBuf, String)>
pub unsafe fn load_all_with_prefix( &self, prefix: Option<&str> ) -> Vec<(Library, PathBuf, String)>
Search and load all librairies with filename starting with LIB_PREFIX+prefix
and ending with LIB_SUFFIX.
The result is a list of tuple with:
- the Library
- its full path
- its short name (i.e. filename stripped of prefix and suffix)
Safety
This function calls libloading::Library::new() which is unsafe.