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 one there, its config.toml a commented skeleton. 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 exists(&self) -> bool

Whether config.toml exists yet: a new target’s is written by its first commit.

Source

pub fn add_source(&mut self, name: SourceName, source: Source) -> Result<()>

Names source name in [sources]; written by the next commit.

Nothing changes when it already does.

§Errors
Source

pub fn add_layer(&mut self, layer: LayerSpec) -> Result<()>

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

§Errors
Source

pub fn layer(&self, name: &ProfileName) -> Option<&LayerSpec>

The layer that applies the profile named name.

Source

pub fn remove_layer(&mut self, name: &ProfileName) -> Result<()>

Removes the layer that applies the profile named name; written by the next commit. Its source stays, for another layer to use.

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.

Source

pub fn rescaffold(&mut self, scaffold: ScaffoldId)

Writes the absent files of scaffold again at the next survey, whatever was decided of it.

Source

pub fn pinned(&self, source: &Source) -> Option<&Oid>

The commit the lock pins source to.

Found by source, not position, so removing or reordering layers leaves the others pinned.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.