Struct multiversx_sc_meta::CargoTomlContents
source · pub struct CargoTomlContents {
pub path: PathBuf,
pub toml_value: Value,
}
Expand description
Contains an in-memory representation of a Cargo.toml file.
Implementation notes:
- Currently contains a raw toml tree, but in principle it could also work with a cargo_toml::Manifest.
- It keeps an ordered representation, thanks to the
toml
preserve_order
feature.
Fields§
§path: PathBuf
§toml_value: Value
Implementations§
source§impl CargoTomlContents
impl CargoTomlContents
pub fn load_from_file<P: AsRef<Path>>(path: P) -> Self
pub fn save_to_file<P: AsRef<Path>>(&self, path: P)
pub fn package_name(&self) -> String
sourcepub fn change_package_name(&mut self, new_package_name: String)
pub fn change_package_name(&mut self, new_package_name: String)
Assumes that a package section already exists.
pub fn dependencies_table(&self) -> Option<&Table>
pub fn dependency(&self, dep_name: &str) -> Option<&Value>
pub fn dependencies_mut(&mut self) -> &mut Table
pub fn local_dependency_paths(&self, ignore_deps: &[&str]) -> Vec<String>
pub fn change_features_for_parent_crate_dep(&mut self, features: &[String])
Trait Implementations§
source§impl Clone for CargoTomlContents
impl Clone for CargoTomlContents
source§fn clone(&self) -> CargoTomlContents
fn clone(&self) -> CargoTomlContents
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 moreAuto Trait Implementations§
impl CodecFromSelf for CargoTomlContents
impl RefUnwindSafe for CargoTomlContents
impl Send for CargoTomlContents
impl Sync for CargoTomlContents
impl Unpin for CargoTomlContents
impl UnwindSafe for CargoTomlContents
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more