pub struct Config {
pub repo_root: PathBuf,
pub spec_home: PathBuf,
pub raw: RawConfig,
pub registry: Registry,
pub implicit: bool,
pub tracked: Option<Arc<TrackedSet>>,
}Fields§
§repo_root: PathBufF1: the repository the configuration was found from: the spec home, or under roots.toml the public repository mapped to it. Code paths typed there are named from it.
spec_home: PathBufThe spec home: the directory holding spec.toml, its owners and documents. Every repository-relative path in the configuration and the corpus is relative to it.
raw: RawConfig§registry: Registry§implicit: boolTrue when no spec.toml was found and defaults are in use.
tracked: Option<Arc<TrackedSet>>When set, walks from the spec home read only these files, plus the local directory and
anything outside the repository (spec check sets it for a full run).
Implementations§
Source§impl Config
impl Config
Sourcepub fn discover(start: &Path) -> Result<Self>
pub fn discover(start: &Path) -> Result<Self>
Finds spec.toml in start or its ancestors. Without one, the nearest git root (or start)
is used with defaults, so the tool works in any directory.
pub fn load(path: &Path) -> Result<Self>
pub fn from_raw(root: PathBuf, raw: RawConfig, implicit: bool) -> Self
Sourcepub fn tracked_only(self) -> Self
pub fn tracked_only(self) -> Self
The same configuration with walks kept to the files git tracks; unchanged outside git.
Sourcepub fn reads(&self, rel: &str, dir: bool) -> bool
pub fn reads(&self, rel: &str, dir: bool) -> bool
Whether a walk from the spec home reads the repository path rel (a file, or a folder
when dir): everything without tracked, else tracked files and the local directory.
pub fn spec_dir(&self) -> &str
Sourcepub fn type_dirs(&self) -> Vec<(String, String)>
pub fn type_dirs(&self) -> Vec<(String, String)>
(directory, type) for each type kept in a directory of its own ([types.<name>] dir),
the directory relative to an owner’s root.
Sourcepub fn path_cite_re(&self) -> Regex
pub fn path_cite_re(&self) -> Regex
The regex that finds plain-text paths to documents: into the spec directory, or to a document file in a type’s own directory.
Sourcepub fn cite_key(&self) -> String
pub fn cite_key(&self) -> String
What a scan’s path citations depend on, so a cache of scans is dropped when it changes.
pub fn manifests(&self) -> Vec<String>
pub fn root_owner(&self) -> &str
pub fn local_dir(&self) -> &str
pub fn expand_path(&self, p: &str) -> PathBuf
Trait Implementations§
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Configwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<OwnerKind>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
*const LeafNode<String, ExternalRoot> is !null: Freeze,
PhantomData<Box<(String, ExternalRoot)>>: Freeze,
*const LeafNode<String, RemoteRoot> is !null: Freeze,
PhantomData<Box<(String, RemoteRoot)>>: Freeze,
*const LeafNode<String, TypeOverride> is !null: Freeze,
PhantomData<Box<(String, TypeOverride)>>: Freeze,
PhantomData<GuardDef>: Freeze,
PhantomData<PluginDef>: Freeze,
PhantomData<CheckOverride>: Freeze,
PhantomData<AssetRoot>: Freeze,
*const LeafNode<String, BudgetLimit> is !null: Freeze,
PhantomData<Box<(String, BudgetLimit)>>: Freeze,
PhantomData<TypeDef>: Freeze,
*const ArcInner<TrackedSet> is !null: Freeze,
PhantomData<ArcInner<TrackedSet>>: Freeze,
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Configwhere
RawVecInner: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
NodeRef<Owned, String, ExternalRoot, LeafOrInternal>: Send,
BoxRaw<(String, ExternalRoot)>: Send,
NodeRef<Owned, String, RemoteRoot, LeafOrInternal>: Send,
BoxRaw<(String, RemoteRoot)>: Send,
NodeRef<Owned, String, TypeOverride, LeafOrInternal>: Send,
BoxRaw<(String, TypeOverride)>: Send,
NodeRef<Owned, String, BudgetLimit, LeafOrInternal>: Send,
BoxRaw<(String, BudgetLimit)>: Send,
NodeRef<Owned, String, Vec<String>, LeafOrInternal>: Send,
BoxRaw<(String, Vec<String>)>: Send,
NodeRef<Owned, String, FieldKind, LeafOrInternal>: Send,
BoxRaw<(String, FieldKind)>: Send,
Arc<TrackedSet>: Send,
impl Sync for Configwhere
RawVecInner: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
NodeRef<Owned, String, ExternalRoot, LeafOrInternal>: Sync,
BoxRaw<(String, ExternalRoot)>: Sync,
NodeRef<Owned, String, RemoteRoot, LeafOrInternal>: Sync,
BoxRaw<(String, RemoteRoot)>: Sync,
NodeRef<Owned, String, TypeOverride, LeafOrInternal>: Sync,
BoxRaw<(String, TypeOverride)>: Sync,
NodeRef<Owned, String, BudgetLimit, LeafOrInternal>: Sync,
BoxRaw<(String, BudgetLimit)>: Sync,
NodeRef<Owned, String, Vec<String>, LeafOrInternal>: Sync,
BoxRaw<(String, Vec<String>)>: Sync,
NodeRef<Owned, String, FieldKind, LeafOrInternal>: Sync,
BoxRaw<(String, FieldKind)>: Sync,
Arc<TrackedSet>: Sync,
impl Unpin for Configwhere
*const u8 is !null: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
*const LeafNode<String, ExternalRoot> is !null: Unpin,
Box<(String, ExternalRoot)>: Unpin,
*const LeafNode<String, RemoteRoot> is !null: Unpin,
Box<(String, RemoteRoot)>: Unpin,
*const LeafNode<String, TypeOverride> is !null: Unpin,
Box<(String, TypeOverride)>: Unpin,
*const LeafNode<String, BudgetLimit> is !null: Unpin,
Box<(String, BudgetLimit)>: Unpin,
*const LeafNode<String, Vec<String>> is !null: Unpin,
Box<(String, Vec<String>)>: Unpin,
*const LeafNode<String, FieldKind> is !null: Unpin,
Box<(String, FieldKind)>: Unpin,
Arc<TrackedSet>: Unpin,
impl UnsafeUnpin for Configwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<OwnerKind>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
*const LeafNode<String, ExternalRoot> is !null: UnsafeUnpin,
PhantomData<Box<(String, ExternalRoot)>>: UnsafeUnpin,
*const LeafNode<String, RemoteRoot> is !null: UnsafeUnpin,
PhantomData<Box<(String, RemoteRoot)>>: UnsafeUnpin,
*const LeafNode<String, TypeOverride> is !null: UnsafeUnpin,
PhantomData<Box<(String, TypeOverride)>>: UnsafeUnpin,
PhantomData<GuardDef>: UnsafeUnpin,
PhantomData<PluginDef>: UnsafeUnpin,
PhantomData<CheckOverride>: UnsafeUnpin,
PhantomData<AssetRoot>: UnsafeUnpin,
*const LeafNode<String, BudgetLimit> is !null: UnsafeUnpin,
PhantomData<Box<(String, BudgetLimit)>>: UnsafeUnpin,
PhantomData<TypeDef>: UnsafeUnpin,
*const ArcInner<TrackedSet> is !null: UnsafeUnpin,
PhantomData<ArcInner<TrackedSet>>: UnsafeUnpin,
impl UnwindSafe for Configwhere
RawVecInner: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BTreeMap<String, ExternalRoot>: UnwindSafe,
BTreeMap<String, RemoteRoot>: UnwindSafe,
BTreeMap<String, TypeOverride>: UnwindSafe,
BTreeMap<String, BudgetLimit>: UnwindSafe,
BTreeMap<String, Vec<String>>: UnwindSafe,
BTreeMap<String, FieldKind>: UnwindSafe,
Arc<TrackedSet>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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