pub struct Target { /* private fields */ }Expand description
A directory devset manages.
Implementations§
Source§impl Target
impl Target
Sourcepub fn find(dir: &Utf8Path) -> Result<Self>
pub fn find(dir: &Utf8Path) -> Result<Self>
The target containing dir: the nearest ancestor holding .devset/config.toml.
§Errors
TargetError::NotFound, no ancestor holds one.Error::Parse, one of its files does not parse.
Sourcepub fn open_or_new(root: &Utf8Path) -> Result<Self>
pub fn open_or_new(root: &Utf8Path) -> Result<Self>
The target rooted at root, or a new, empty one there. Never one inside another target.
§Errors
TargetError::Nested,rootlies inside another target.Error::Parse, one of its files does not parse.
Sourcepub fn add_layer(&mut self, source: Source) -> Result<()>
pub fn add_layer(&mut self, source: Source) -> Result<()>
Appends source as the last layer; written by the next commit.
§Errors
TargetError::DuplicateLayer, the layer is already present.Error::Parse,layersinconfig.tomlis not a list of tables.Error::Io, the layer cannot be written as TOML.
Sourcepub fn layer(&self, name: &str) -> Option<&Source>
pub fn layer(&self, name: &str) -> Option<&Source>
The source of the layer whose profile has name, as the lock last recorded it.
Sourcepub fn remove_layer(&mut self, source: &Source, name: &str) -> Result<()>
pub fn remove_layer(&mut self, source: &Source, name: &str) -> Result<()>
Removes the layer at source; written by the next commit.
Every [files] override that picks it, from = "<name>", goes with it.
§Errors
Error::Parse, config.toml changed shape so that the layer
cannot be found in it.
Sourcepub fn remove_override(&mut self, path: &RelPath) -> Result<()>
pub fn remove_override(&mut self, path: &RelPath) -> Result<()>
Removes the [files."path"] override; written by the next commit.
§Errors
Error::Parse, as add_layer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnsafeUnpin for Target
impl UnwindSafe for Target
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