[][src]Struct homebins::Home

pub struct Home { /* fields omitted */ }

The home directory.

Keeps track of the $HOME path and other directories we need to access.

Implementations

impl Home[src]

pub fn open() -> Home[src]

Open the real $HOME directory.

This function can panic if the dirs crate cannot figure out either $HOME or $XDG_CACHE_DIR.

pub fn check_environment(&self) -> Result<(), Error>[src]

Check whether the environment is ok, and print warnings to stderr if not.

pub fn download_dir(&self) -> PathBuf[src]

The directory to download files from manifests to.

This is a subdirectory of our cache directory.

pub fn manifest_download_dir(&self, manifest: &Manifest) -> PathBuf[src]

The download directory for a specific manifest.

This is a subdirectory of the download directory with the name and the version of the given manifest.

pub fn manifest_repos_dir(&self) -> PathBuf[src]

The directory to clone manifest repositories to.

This is a subdirectory of our cache directory.

pub fn bin_dir(&self) -> PathBuf[src]

The directory to install binaries to.

This is $HOME/.local/bin.

pub fn man_dir(&self) -> PathBuf[src]

Get the man directory.

This is $HOME/.local/share/man.

pub fn man_section_dir(&self, section: u8) -> PathBuf[src]

The directory to install man pages of the given section to.

This is the corresponding sub-directory of the man_dir.

pub fn manifest_store(&mut self) -> Result<ManifestStore>[src]

Get the manifest store to install from.

pub fn installed_manifest_version(
    &self,
    manifest: &Manifest
) -> Result<Option<Versioning>, Error>
[src]

Get the installed version of the given manifest.

Attempt to invoke the version check denoted in the manifest, i.e. the given binary with the version check arguments, and use the pattern to extract a version number.

Return None if the binary doesn't exist; fail if we cannot invoke it for other reasons or if we fail to parse the version from other.

pub fn outdated_manifest_version(
    &self,
    manifest: &Manifest
) -> Result<Option<Versioning>, Error>
[src]

Whether the given manifest is outdated and needs updating.

Return the installed version if it's outdated, otherwise return None.

pub fn target_dir(&self, target: Target) -> PathBuf[src]

The target directory for a given target.

pub fn target_name<'a>(
    &self,
    source: &'a Path,
    name: Option<&'a str>
) -> Result<&'a OsStr>
[src]

Obtain the name of a target file from the given explicit name or the source.

pub fn installed_files(
    &self,
    manifest: &Manifest
) -> Result<Vec<PathBuf>, Error>
[src]

Get all files a given manifest would install.

pub fn install_manifest(&mut self, manifest: &Manifest) -> Result<(), Error>[src]

Install a manifest.

Download the files denoted by the given manifest, extract as needed and then copy files to $HOME as described in the manifest.

pub fn remove_manifest(
    &mut self,
    manifest: &Manifest
) -> Result<Vec<PathBuf>, Error>
[src]

Remove all files installed by the given manifest.

Returns all removed files.

Auto Trait Implementations

impl RefUnwindSafe for Home

impl Send for Home

impl Sync for Home

impl Unpin for Home

impl UnwindSafe for Home

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,