Skip to main content

ResolveCtx

Struct ResolveCtx 

Source
pub struct ResolveCtx<'a> {
    pub project_aube_config: &'a [(String, String)],
    pub project_npmrc: &'a [(String, String)],
    pub user_aube_config: &'a [(String, String)],
    pub user_npmrc: &'a [(String, String)],
    pub workspace_yaml: &'a BTreeMap<String, Value>,
    pub env: &'a [(String, String)],
    pub cli: &'a [(String, String)],
    pub embedder_defaults: &'a [(String, String)],
}
Expand description

Bundle of source inputs consumed by the per-setting typed accessors in resolved. Each field is a borrowed view so callers can reuse the same owned values across many lookups without cloning.

File-source fields are split by scope (user vs project) so the resolver can apply the locality principle — project-scope entries outrank user-scope entries, and within a scope aube’s own config outranks .npmrc. See the module-level docs for the full chain.

Fields§

§project_aube_config: &'a [(String, String)]

Project-scope aube config (<cwd>/.config/aube/config.toml). Highest-precedence file source by default — a project may pin settings here as an alternative to committing them into the project .npmrc shared with npm/pnpm/yarn.

§project_npmrc: &'a [(String, String)]

Project-scope .npmrc (<cwd>/.npmrc) plus any npmrcAuthFile it points at, in load order.

§user_aube_config: &'a [(String, String)]

User-scope aube config (~/.config/aube/config.toml). Aube’s authoritative store for user-level settings written via aube config set — outranks ~/.npmrc so leftover entries in a shared .npmrc don’t silently shadow what aube wrote.

§user_npmrc: &'a [(String, String)]

User-scope .npmrc (~/.npmrc or NPM_CONFIG_USERCONFIG) plus pnpm’s global auth.ini, in load order.

§workspace_yaml: &'a BTreeMap<String, Value>

Raw top-level map from pnpm-workspace.yaml / aube-workspace.yaml, as returned by aube_manifest::workspace::load_raw.

§env: &'a [(String, String)]

Captured environment variables relevant to settings. In production this is populated by capture_env; tests build a literal slice. sources.env alias order defines priority; within one alias, lookups iterate from the end so later entries win.

§cli: &'a [(String, String)]

Parsed CLI flag values for the command being executed. Each entry is a (flag_name, value) pair where flag_name matches a sources.cli alias declared in settings.toml. Values should already be normalized to the raw form the type-specific parser expects ("true"/"false" for bools, etc).

§embedder_defaults: &'a [(String, String)]

Lowest-priority defaults supplied by an embedder. An embedding host (a tool that drives aube’s command layer as a library) feeds setting defaults here through the normal settings path; every user- and project-level source overrides them. Standalone aube leaves this empty, so the per-setting built-in defaults from settings.toml apply unchanged. Keyed by the same canonical setting names as the file sources.

Implementations§

Source§

impl<'a> ResolveCtx<'a>

Source

pub fn files_only( npmrc: &'a [(String, String)], workspace_yaml: &'a BTreeMap<String, Value>, ) -> Self

Construct a context that only sees the merged-.npmrc and workspace-yaml file sources. Convenience for tests and call sites that don’t need scope splitting or env/cli plumbing.

The supplied .npmrc slice is treated as project-scope so its values win over the (empty) user-scope sources — matching the install-time precedence callers used to rely on before the split.

Auto Trait Implementations§

§

impl<'a> Freeze for ResolveCtx<'a>

§

impl<'a> RefUnwindSafe for ResolveCtx<'a>

§

impl<'a> Send for ResolveCtx<'a>

§

impl<'a> Sync for ResolveCtx<'a>

§

impl<'a> Unpin for ResolveCtx<'a>

§

impl<'a> UnsafeUnpin for ResolveCtx<'a>

§

impl<'a> UnwindSafe for ResolveCtx<'a>

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more