[][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.

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

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

Trait Implementations

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

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

Auto Trait Implementations

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

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

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

impl<'cfg> Unpin for PathSource<'cfg>

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

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,