Module paths

Source
Expand description

Resolves a file path to a manifest file

Constants§

DEFAULT_MANIFEST_FILE
The name given to the default manifest file.

Functions§

find_manifest_file_path
Attempts to find a manifest. If a path is provided, that path is resolved using resolve_manifest_file_path; otherwise, a directory search is carried out using search_upwards_for_manifest. If we had to search, and a manifest is found, a (non-zero) usize is returned indicating how far above the current directory it was found. (A usize of 0 indicates that the manifest was provided or found in the current directory.) This can be used to notify the user that a non-default manifest is being used.
parent_dir
Resolves the parent directory of a path, returning an error if the path has no parent. A path with a single component will return “.”.
resolve_manifest_file_path
Resolves a manifest path provided by a user, which may be a file or directory, to a path to a manifest file.
search_upwards_for_manifest
Starting from the current directory, searches upward through the directory tree for a manifest (that is, a file with the default manifest name spin.toml). If found, the path to the manifest is returned, with a usize indicating how far above the current directory it was found. (A usize of 0 indicates that the manifest was provided or found in the current directory.) This can be used to notify the user that a non-default manifest is being used. If no matching file is found, the function returns None.