Struct standard_paths::StandardPaths [] [src]

pub struct StandardPaths { /* fields omitted */ }

Stores application and organization names and provides all the crate methods.

Methods

impl StandardPaths
[src]

[src]

Constructs a new StandardPaths with the application name derived from the CARGO_PKG_NAME variable.

[src]

Constructs a new StandardPaths with the provided app and organization names.

[src]

Returns the directory where files of type location should be written to.

Note: the returned path can be a directory that does not exist.

Returns Error if the location cannot be determined.

Arguments

  • location - location type.

[src]

Returns all the directories of type location.

The vector of locations is sorted by priority, starting with self.writable location if it can be determined.

Returns Error if the locations cannot be determined or an empty vector if no locations for the provided type are defined.

Arguments

  • location - location type.

[src]

Returns the absolute file path to the executable with name in the system path.

It also could be used to check a path to be an executable.

Internally it calls the self.find_executable_in_paths method with the system path as the paths argument. On most operating systems the system path is determined by the PATH environment variable.

Note: on Windows the executable extensions from the PATHEXT environment variable are automatically appended to the name if it doesn't contain any extension.

Returns None if no executables are found or if the provided path is not executable.

Arguments

  • name - the name of the searched executable or an absolute path which should be checked to be executable.

[src]

Returns the absolute file path to the executable with name in the provided paths.

Note: on Windows the executable extensions from the PATHEXT environment variable are automatically appended to the name if it doesn't contain any extension.

Returns None if no executables are found or if the provided path is not executable.

Arguments

  • name - the name of the searched executable or an absolute path which should be checked to be executable.
  • paths - the directories where to search for the executable.

[src]

Search for a file or directory called 'name' in the standard locations.

Returns a full path to the first file or directory found.

Returns Error if accessing the location failed or None if no such file or directory can be found.

Arguments

  • location - the location type where to search.
  • name - the name of the file or directory to search.
  • option - the type of entry to search.

[src]

Search for all files or directories called 'name' in the standard locations.

Returns a vector of full paths to the all files or directories found.

Returns Error if accessing the location failed or None if no such files or directories can be found.

Arguments

  • location - the location type where to search.
  • name - the name of the files or directories to search.
  • option - the type of entries to search.