pub struct Home { /* private fields */ }Expand description
A structure of home.
The home contains paths to the Unlab-gpu home directory, configuration files, history file. By default, the Unlab-gpu home directory is located in the home directory. Also, the binary paths, the library paths, and the documentation paths are in the home. The Unlab-gpu home directory or the work directory of current package has the binary directory, the library directory, and the documentation directory by default.
Implementations§
Source§impl Home
impl Home
Sourcepub fn new(
home_dir: &Option<String>,
bin_path: &Option<String>,
lib_path: &Option<String>,
doc_path: &Option<String>,
is_work_dir: bool,
) -> Option<Self>
pub fn new( home_dir: &Option<String>, bin_path: &Option<String>, lib_path: &Option<String>, doc_path: &Option<String>, is_work_dir: bool, ) -> Option<Self>
Creates a home.
This method takes the Unlab-gpu home directory, the paths. The binary directory, the library directory, and the documentation directory are located in the Unlab-gpu by default if the flag of work directory isn’t set, otherwise these directories are located in the work directory of current package by default.
Sourcepub fn backend_config_file(&self) -> &Path
pub fn backend_config_file(&self) -> &Path
Returns th path to the file of backend configuration.
Sourcepub fn history_file(&self) -> &Path
pub fn history_file(&self) -> &Path
Returns the path to the history file.
Sourcepub fn pkg_config_file(&self) -> &Path
pub fn pkg_config_file(&self) -> &Path
Returns the path to the file of package configuration.
Sourcepub fn add_dirs_to_bin_path(
&mut self,
dirs: &[String],
) -> Result<(), JoinPathsError>
pub fn add_dirs_to_bin_path( &mut self, dirs: &[String], ) -> Result<(), JoinPathsError>
Adds the directory paths to the binary paths.
Each directory path is pushed front to the binary paths. An addition order of directory paths is determined by the order of directory paths on the slice.
Sourcepub fn add_dirs_to_lib_path(
&mut self,
dirs: &[String],
) -> Result<(), JoinPathsError>
pub fn add_dirs_to_lib_path( &mut self, dirs: &[String], ) -> Result<(), JoinPathsError>
Adds the directory paths to the library paths.
See add_dirs_to_bin_path.
Sourcepub fn add_dirs_to_doc_path(
&mut self,
dirs: &[String],
) -> Result<(), JoinPathsError>
pub fn add_dirs_to_doc_path( &mut self, dirs: &[String], ) -> Result<(), JoinPathsError>
Adds the directory paths to the documentation paths.
See add_dirs_to_bin_path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Home
impl RefUnwindSafe for Home
impl Send for Home
impl Sync for Home
impl Unpin for Home
impl UnsafeUnpin for Home
impl UnwindSafe for Home
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.