[][src]Struct cargo::sources::path::PathSource

pub struct PathSource<'cfg> { /* fields omitted */ }

Methods

impl<'cfg> PathSource<'cfg>[src]

pub fn new(
    path: &Path,
    source_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]

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 preload_with(&mut self, pkg: Package)[src]

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:

  1. Only warn users about the future change iff their matching rules are affected. (CURRENT STAGE)

  2. Switch to the new strategy and update documents. Still keep warning affected users.

  3. Drop the old strategy and no more warnings.

See https://github.com/rust-lang/cargo/issues/4268 for more info.

pub fn last_modified_file(
    &self,
    pkg: &Package
) -> CargoResult<(FileTime, PathBuf)>
[src]

pub fn path(&self) -> &Path[src]

Trait Implementations

impl<'cfg> Source for PathSource<'cfg>[src]

fn replaced_source_id(&self) -> SourceId[src]

Returns the replaced SourceId corresponding to this source

fn query_vec(&mut self, dep: &Dependency) -> CargoResult<Vec<Summary>>[src]

fn verify(&self, _pkg: PackageId) -> CargoResult<()>[src]

If this source supports it, verifies the source of the package specified. Read more

fn is_replaced(&self) -> bool[src]

Returns whether a source is being replaced by another here

impl<'cfg> Debug for PathSource<'cfg>[src]

Auto Trait Implementations

impl<'cfg> !Send for PathSource<'cfg>

impl<'cfg> !Sync for PathSource<'cfg>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self