[][src]Struct appimage_environment::Environment

pub struct Environment;

The struct Environment contains some environment-informations about the appimage. For example, you can get the values of the appimage environment variables.

Implementations

impl Environment[src]

pub fn appdir() -> Result<String>[src]

If the binary lies into an appimage, this method returns the appimage environment variable "APPDIR" (absolute path to AppImage file, with symlinks resolved) See AppImage documentation for more details.

pub fn appimage() -> Result<String>[src]

If the binary lies into an appimage, this method returns the appimage environment variable "APPIMAGE". See AppImage documentation for more details.

pub fn owd() -> Result<String>[src]

If the binary lies into an appimage, this method returns the appimage environment variable "OWD". See AppImage documentation for more details.

pub fn argv0() -> Result<String>[src]

If the binary lies into an appimage, this method returns the appimage environment variable "ARGV0". See AppImage documentation for more details.

pub fn get_path_of<S: Into<String>>(toolname: S) -> Result<PathBuf>[src]

If the binary lies into an appimage, this method will attempt to return the full path of the given toolname.

Example

extern crate appimage_environment;
use appimage_environment::Environment;
 
fn main() {
	println!("My examplebinary: {:?}", Environment::get_path_of("lspci"));
}

pub fn get_all_bins() -> Result<Vec<PathBuf>>[src]

This function returns all paths of binaries which are in the appropriate binary paths of the appimage. The appropriate paths can be found in PATH.

pub fn get_data_path() -> Result<PathBuf>[src]

This function returns the path of "/data" of the appimage.

pub fn get_web_path() -> Result<PathBuf>[src]

This function returns the path of "/web" of the appimage.

Auto Trait Implementations

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, 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.