Skip to main content

Target

Struct Target 

Source
pub struct Target { /* private fields */ }
Expand description

A directory devset manages.

Implementations§

Source§

impl Target

Source

pub fn find(dir: &Utf8Path) -> Result<Self>

The target containing dir: the nearest ancestor holding .devset/config.toml.

§Errors
Source

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
Source

pub fn root(&self) -> &Utf8Path

The directory holding .devset/.

Source

pub const fn config(&self) -> &Config

config.toml.

Source

pub fn add_layer(&mut self, source: Source) -> Result<()>

Appends source as the last layer; written by the next commit.

§Errors
Source

pub fn layer(&self, name: &str) -> Option<&Source>

The source of the layer whose profile has name, as the lock last recorded it.

Source

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.

Source

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.

Source

pub fn answer(&mut self, name: VarName, value: String)

Answers name; written by the next commit.

Source

pub const fn answers(&self) -> &BTreeMap<VarName, String>

Every answer: recorded, or given since.

Trait Implementations§

Source§

impl Debug for Target

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.