Skip to main content

ApcliGroup

Struct ApcliGroup 

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

Visibility configuration for the built-in apcli command group.

Instantiated via ApcliGroup::from_cli_config (Tier 1) or ApcliGroup::from_yaml (Tier 3). The constructor is private to preserve the Tier-1-vs-Tier-3 flag distinction.

Implementations§

Source§

impl ApcliGroup

Source

pub fn from_cli_config( config: Option<ApcliConfig>, registry_injected: bool, ) -> Self

Tier 1 constructor — config came from a programmatic embedder (i.e. an ApcliConfig value passed to a future embedding API).

A non-auto mode from this tier wins over env var and yaml. Because ApcliConfig is strongly typed, no validation is needed here.

Source

pub fn from_yaml(yaml_value: Option<Value>, registry_injected: bool) -> Self

Tier 3 constructor — config came from apcore.yaml.

Env var (Tier 2) may override the yaml-supplied mode unless disable_env is true. On validation error, prints a message to stderr and calls std::process::exit with EXIT_INVALID_INPUT; the fallible variant ApcliGroup::try_from_yaml is available for tests.

Source

pub fn try_from_yaml( yaml_value: Option<Value>, registry_injected: bool, ) -> Result<Self, ApcliGroupError>

Fallible sibling of ApcliGroup::from_yaml. Used by tests; the production wrapper prints the error and exits.

Source

pub fn resolve_visibility(&self) -> &'static str

Resolve effective visibility after applying the four-tier precedence.

Returns one of "all" | "none" | "include" | "exclude" — never "auto". Tier order (spec §4.4):

  1. from_cli_config with a non-auto mode wins outright.
  2. APCORE_CLI_APCLI env var (unless sealed by disable_env).
  3. yaml non-auto mode.
  4. Auto-detect: registry_injected ? "none" : "all".
Source

pub fn is_subcommand_included(&self, subcommand: &str) -> bool

Return true iff subcommand passes the include/exclude filter.

Callers MUST first check ApcliGroup::resolve_visibility — this method panics if called under modes "all" or "none" (caller bug per spec §4.6).

Source

pub fn is_group_visible(&self) -> bool

True iff the apcli group itself should appear in root --help.

Source

pub fn include(&self) -> &[String]

Enumerate the effective include list. Empty unless resolved mode is "include".

Source

pub fn exclude(&self) -> &[String]

Enumerate the effective exclude list. Empty unless resolved mode is "exclude".

Source

pub fn disable_env(&self) -> bool

True iff Tier 2 env-var lookup is sealed.

Trait Implementations§

Source§

impl Debug for ApcliGroup

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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