pub struct ConfigLayerStack { /* private fields */ }Implementations§
Source§impl ConfigLayerStack
impl ConfigLayerStack
pub fn new( layers: Vec<ConfigLayerEntry>, requirements: ConfigRequirements, requirements_toml: ConfigRequirementsToml, ) -> Result<Self>
pub fn with_user_and_project_exec_policy_rules_ignored( self, ignore_user_and_project_exec_policy_rules: bool, ) -> Self
pub fn ignore_user_and_project_exec_policy_rules(&self) -> bool
pub fn startup_warnings(&self) -> Option<&[String]>
Sourcepub fn get_active_user_layer(&self) -> Option<&ConfigLayerEntry>
pub fn get_active_user_layer(&self) -> Option<&ConfigLayerEntry>
Returns the active raw user config layer, if any.
This does not merge other config layers or apply any requirements. When
a profile-v2 layer is active, this returns that profile layer rather than
the base $CODEX_HOME/config.toml layer because the active layer is the
writable target for profile-aware edits.
pub fn get_user_config_file(&self) -> Option<&AbsolutePathBuf>
Sourcepub fn get_user_layers(
&self,
ordering: ConfigLayerStackOrdering,
include_disabled: bool,
) -> Vec<&ConfigLayerEntry>
pub fn get_user_layers( &self, ordering: ConfigLayerStackOrdering, include_disabled: bool, ) -> Vec<&ConfigLayerEntry>
Returns all user config layers in the requested precedence order.
With profile-v2 enabled, LowestPrecedenceFirst returns the base user
config before the profile overlay, while HighestPrecedenceFirst returns
the profile overlay before the base user config.
Sourcepub fn effective_user_config(&self) -> Option<TomlValue>
pub fn effective_user_config(&self) -> Option<TomlValue>
Returns the merged config from enabled user layers only.
When profile config is active, this includes the base user config followed by the profile override config.
pub fn requirements(&self) -> &ConfigRequirements
pub fn requirements_toml(&self) -> &ConfigRequirementsToml
Sourcepub fn with_user_config(
&self,
config_toml: &AbsolutePathBuf,
user_config: TomlValue,
) -> Result<Self>
pub fn with_user_config( &self, config_toml: &AbsolutePathBuf, user_config: TomlValue, ) -> Result<Self>
Creates a new ConfigLayerStack using the specified values to inject one
user layer into the stack. If such a layer already exists, it is replaced;
otherwise, it is inserted into the stack at the appropriate position
based on precedence rules. When the stack has both base and profile-v2
user layers, this updates only the layer whose file matches
config_toml.
pub fn with_user_config_profile( &self, config_toml: &AbsolutePathBuf, profile: Option<&ProfileV2Name>, user_config: TomlValue, ) -> Result<Self>
Sourcepub fn with_user_layer_from(&self, other: &Self) -> Self
pub fn with_user_layer_from(&self, other: &Self) -> Self
Returns a new stack with the user layer copied from other, preserving
every non-user layer already present in this stack.
Sourcepub fn effective_config(&self) -> TomlValue
pub fn effective_config(&self) -> TomlValue
Returns the merged config-layer view.
This only merges ordinary config layers. Requirements are composed and tracked separately.
Sourcepub fn origins(&self) -> HashMap<String, ConfigLayerMetadata>
pub fn origins(&self) -> HashMap<String, ConfigLayerMetadata>
Returns field origins for the merged config-layer view.
Requirement sources are tracked separately and are not included here.
Sourcepub fn layers_high_to_low(&self) -> Vec<&ConfigLayerEntry>
pub fn layers_high_to_low(&self) -> Vec<&ConfigLayerEntry>
Returns config layers from highest precedence to lowest precedence.
Requirement sources are tracked separately and are not included here.
Sourcepub fn get_layers(
&self,
ordering: ConfigLayerStackOrdering,
include_disabled: bool,
) -> Vec<&ConfigLayerEntry>
pub fn get_layers( &self, ordering: ConfigLayerStackOrdering, include_disabled: bool, ) -> Vec<&ConfigLayerEntry>
Returns config layers in the requested precedence order.
Requirement sources are tracked separately and are not included here.
Trait Implementations§
Source§impl Clone for ConfigLayerStack
impl Clone for ConfigLayerStack
Source§fn clone(&self) -> ConfigLayerStack
fn clone(&self) -> ConfigLayerStack
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigLayerStack
impl Debug for ConfigLayerStack
Source§impl Default for ConfigLayerStack
impl Default for ConfigLayerStack
Source§fn default() -> ConfigLayerStack
fn default() -> ConfigLayerStack
Source§impl PartialEq for ConfigLayerStack
impl PartialEq for ConfigLayerStack
impl StructuralPartialEq for ConfigLayerStack
Auto Trait Implementations§
impl !RefUnwindSafe for ConfigLayerStack
impl !UnwindSafe for ConfigLayerStack
impl Freeze for ConfigLayerStack
impl Send for ConfigLayerStack
impl Sync for ConfigLayerStack
impl Unpin for ConfigLayerStack
impl UnsafeUnpin for ConfigLayerStack
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<T> AsTypeStaticRegistered for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<T> HasTyVTable for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request