pub struct JsonConfigSource { /* private fields */ }Expand description
A project’s composer.json, edited in place.
Implementations§
Source§impl JsonConfigSource
impl JsonConfigSource
pub fn new(path: impl Into<PathBuf>) -> Self
Sourcepub fn remove_link(
&self,
link_type: &str,
name: &str,
) -> Result<(), ConfigSourceError>
pub fn remove_link( &self, link_type: &str, name: &str, ) -> Result<(), ConfigSourceError>
removeLink: removes $name from the section, then the section if
it is empty.
Sourcepub fn add_link(
&self,
link_type: &str,
name: &str,
constraint: &str,
sort: bool,
) -> Result<(), ConfigSourceError>
pub fn add_link( &self, link_type: &str, name: &str, constraint: &str, sort: bool, ) -> Result<(), ConfigSourceError>
addLink (sorting is decided by the caller, as RequireCommand reads
config.sort-packages).
Sourcepub fn remove_config_setting(&self, name: &str) -> Result<(), ConfigSourceError>
pub fn remove_config_setting(&self, name: &str) -> Result<(), ConfigSourceError>
removeConfigSetting for a config key (allow-plugins,
allow-plugins.vendor/name).
Auto Trait Implementations§
impl Freeze for JsonConfigSource
impl RefUnwindSafe for JsonConfigSource
impl Send for JsonConfigSource
impl Sync for JsonConfigSource
impl Unpin for JsonConfigSource
impl UnsafeUnpin for JsonConfigSource
impl UnwindSafe for JsonConfigSource
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more