pub struct LocalManifest {
pub path: PathBuf,
pub manifest: Manifest,
}
Expand description
An editable Cargo manifest that is available locally.
Fields§
§path: PathBuf
Path to the manifest.
manifest: Manifest
Manifest contents.
Implementations§
source§impl LocalManifest
impl LocalManifest
sourcepub fn try_new(path: &Path) -> CargoResult<Self>
pub fn try_new(path: &Path) -> CargoResult<Self>
Construct the LocalManifest
corresponding to the Path
provided..
sourcepub fn write(&self) -> CargoResult<()>
pub fn write(&self) -> CargoResult<()>
Write changes back to the file.
sourcepub fn get_dependency_versions<'s>(
&'s self,
dep_key: &'s str
) -> impl Iterator<Item = (DepTable, CargoResult<Dependency>)> + 's
pub fn get_dependency_versions<'s>( &'s self, dep_key: &'s str ) -> impl Iterator<Item = (DepTable, CargoResult<Dependency>)> + 's
Lookup a dependency.
sourcepub fn insert_into_table(
&mut self,
table_path: &[String],
dep: &Dependency
) -> CargoResult<()>
pub fn insert_into_table( &mut self, table_path: &[String], dep: &Dependency ) -> CargoResult<()>
Add entry to a Cargo.toml.
sourcepub fn remove_from_table(
&mut self,
table_path: &[String],
name: &str
) -> CargoResult<()>
pub fn remove_from_table( &mut self, table_path: &[String], name: &str ) -> CargoResult<()>
Remove entry from a Cargo.toml.
Methods from Deref<Target = Manifest>§
sourcepub fn package_name(&self) -> CargoResult<&str>
pub fn package_name(&self) -> CargoResult<&str>
Get the manifest’s package name.
sourcepub fn get_table<'a>(&'a self, table_path: &[String]) -> CargoResult<&'a Item>
pub fn get_table<'a>(&'a self, table_path: &[String]) -> CargoResult<&'a Item>
Get the specified table from the manifest.
sourcepub fn get_table_mut<'a>(
&'a mut self,
table_path: &[String]
) -> CargoResult<&'a mut Item>
pub fn get_table_mut<'a>( &'a mut self, table_path: &[String] ) -> CargoResult<&'a mut Item>
Get the specified table from the manifest.
sourcepub fn get_sections(&self) -> Vec<(DepTable, Item)>
pub fn get_sections(&self) -> Vec<(DepTable, Item)>
Get all sections in the manifest that exist and might contain
dependencies. The returned items are always Table
or
InlineTable
.
pub fn get_legacy_sections(&self) -> Vec<String>
Trait Implementations§
source§impl Clone for LocalManifest
impl Clone for LocalManifest
source§fn clone(&self) -> LocalManifest
fn clone(&self) -> LocalManifest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more