[−][src]Struct cargo::sources::path::PathSource
Methods
impl<'cfg> PathSource<'cfg>
[src]
pub fn new(
path: &Path,
source_id: SourceId,
config: &'cfg Config
) -> PathSource<'cfg>
[src]
path: &Path,
source_id: SourceId,
config: &'cfg Config
) -> PathSource<'cfg>
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 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:
-
Only warn users about the future change iff their matching rules are affected. (CURRENT STAGE)
-
Switch to the new strategy and update documents. Still keep warning affected users.
-
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]
&self,
pkg: &Package
) -> CargoResult<(FileTime, PathBuf)>
pub fn path(&self) -> &Path
[src]
Trait Implementations
impl<'cfg> Source for PathSource<'cfg>
[src]
fn query(
&mut self,
dep: &Dependency,
f: &mut dyn FnMut(Summary)
) -> CargoResult<()>
[src]
&mut self,
dep: &Dependency,
f: &mut dyn FnMut(Summary)
) -> CargoResult<()>
fn fuzzy_query(
&mut self,
_dep: &Dependency,
f: &mut dyn FnMut(Summary)
) -> CargoResult<()>
[src]
&mut self,
_dep: &Dependency,
f: &mut dyn FnMut(Summary)
) -> CargoResult<()>
fn supports_checksums(&self) -> bool
[src]
fn requires_precise(&self) -> bool
[src]
fn source_id(&self) -> SourceId
[src]
fn update(&mut self) -> CargoResult<()>
[src]
fn download(&mut self, id: PackageId) -> CargoResult<MaybePackage>
[src]
fn finish_download(
&mut self,
_id: PackageId,
_data: Vec<u8>
) -> CargoResult<Package>
[src]
&mut self,
_id: PackageId,
_data: Vec<u8>
) -> CargoResult<Package>
fn fingerprint(&self, pkg: &Package) -> CargoResult<String>
[src]
fn describe(&self) -> String
[src]
fn add_to_yanked_whitelist(&mut self, _pkgs: &[PackageId])
[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]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self