Struct cargo::sources::path::PathSource
[−]
[src]
pub struct PathSource<'cfg> { /* fields omitted */ }
Methods
impl<'cfg> PathSource<'cfg>
[src]
pub fn new(path: &Path, id: &SourceId, config: &'cfg Config) -> PathSource<'cfg>
[src]
Invoked with an absolute path to a directory that contains a Cargo.toml.
This source will only return the package at precisely the path
specified, and it will be an error if there's not a package at path
.
pub fn new_recursive(
root: &Path,
id: &SourceId,
config: &'cfg Config
) -> PathSource<'cfg>
[src]
root: &Path,
id: &SourceId,
config: &'cfg Config
) -> PathSource<'cfg>
Creates a new source which is walked recursively to discover packages.
This is similar to the new
method except that instead of requiring a
valid package to be present at root
the folder is walked entirely to
crawl for packages.
Note that this should be used with care and likely shouldn't be chosen by default!
pub fn root_package(&mut self) -> CargoResult<Package>
[src]
pub fn read_packages(&self) -> CargoResult<Vec<Package>>
[src]
pub fn list_files(&self, pkg: &Package) -> CargoResult<Vec<PathBuf>>
[src]
List all files relevant to building this package inside this source.
This function will use the appropriate methods to determine the
set of files underneath this source's directory which are relevant for
building pkg
.
The basic assumption of this method is that all files in the directory are relevant for building this package, but it also contains logic to use other methods like .gitignore to filter the list of files.
Pattern matching strategy
Migrating from a glob-like pattern matching (using glob
crate) to a
gitignore-like pattern matching (using ignore
crate). The migration
stages are:
-
Only warn users about the future change iff their matching rules are affected. (CURRENT STAGE)
-
Switch to the new strategy and upate documents. Still keep warning affected users.
-
Drop the old strategy and no mor warnings.
See https://github.com/rust-lang/cargo/issues/4268 for more info.
Trait Implementations
impl<'cfg> Debug for PathSource<'cfg>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'cfg> Registry for PathSource<'cfg>
[src]
fn query(&mut self, dep: &Dependency, f: &mut FnMut(Summary)) -> CargoResult<()>
[src]
Attempt to find the packages that match a dependency request.
fn supports_checksums(&self) -> bool
[src]
Returns whether or not this registry will return summaries with checksums listed. Read more
fn requires_precise(&self) -> bool
[src]
Returns whether or not this registry will return summaries with the precise
field in the source id listed. Read more
fn query_vec(&mut self, dep: &Dependency) -> CargoResult<Vec<Summary>>
[src]
impl<'cfg> Source for PathSource<'cfg>
[src]
fn source_id(&self) -> &SourceId
[src]
Returns the SourceId
corresponding to this source
fn update(&mut self) -> CargoResult<()>
[src]
The update method performs any network operations required to get the entire list of all names, versions and dependencies of packages managed by the Source. Read more
fn download(&mut self, id: &PackageId) -> CargoResult<Package>
[src]
The download method fetches the full package for each name and version specified. Read more
fn fingerprint(&self, pkg: &Package) -> CargoResult<String>
[src]
Generates a unique string which represents the fingerprint of the current state of the source. Read more
fn verify(&self, _pkg: &PackageId) -> CargoResult<()>
[src]
If this source supports it, verifies the source of the package specified. Read more