pub struct Environment;Expand description
The struct Environment contains some environment-informations about the appimage. For example, you can get the values of the appimage environment variables.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn appdir() -> Result<String>
pub fn appdir() -> Result<String>
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.
Sourcepub fn appimage() -> Result<String>
pub fn appimage() -> Result<String>
If the binary lies into an appimage, this method returns the appimage environment variable “APPIMAGE”. See AppImage documentation for more details.
Sourcepub fn owd() -> Result<String>
pub fn owd() -> Result<String>
If the binary lies into an appimage, this method returns the appimage environment variable “OWD”. See AppImage documentation for more details.
Sourcepub fn argv0() -> Result<String>
pub fn argv0() -> Result<String>
If the binary lies into an appimage, this method returns the appimage environment variable “ARGV0”. See AppImage documentation for more details.
Sourcepub fn get_path_of<S: Into<String>>(toolname: S) -> Result<PathBuf>
pub fn get_path_of<S: Into<String>>(toolname: S) -> Result<PathBuf>
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"));
}Sourcepub fn get_all_bins() -> Result<Vec<PathBuf>>
pub fn get_all_bins() -> Result<Vec<PathBuf>>
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.
Sourcepub fn get_data_path() -> Result<PathBuf>
pub fn get_data_path() -> Result<PathBuf>
This function returns the path of “/data” of the appimage.
Sourcepub fn get_web_path() -> Result<PathBuf>
pub fn get_web_path() -> Result<PathBuf>
This function returns the path of “/web” of the appimage.