pub struct Builder<'a> { /* private fields */ }Expand description
A catalog under construction.
Implementations§
Source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
Sourcepub fn under(self, parent: impl Into<String>, spec: Spec) -> Self
pub fn under(self, parent: impl Into<String>, spec: Spec) -> Self
Attach a supplied plugin spec beneath a static command path.
Components may use visible or hidden static aliases; construction stores the canonical path. The parent must declare an external-subcommand catch-all.
Sourcepub const fn completions(self, overlays: &'a [CompletionOverlay<'a>]) -> Self
pub const fn completions(self, overlays: &'a [CompletionOverlay<'a>]) -> Self
Register the host’s own completion callbacks, as
usage_argv::complete::App::completions would.
Words before a runtime command are the host’s, and the host’s engine answers for them — so whatever it was given, it keeps.
Sourcepub const fn project(self, command_path: &'a str) -> Self
pub const fn project(self, command_path: &'a str) -> Self
Answer as though this command path came after argv0, for a multicall binary.
The same projection usage_argv::complete::App::project applies, applied once, before
anything asks where the words are.
Sourcepub fn build(self) -> Result<Catalog<'a>, Error>
pub fn build(self) -> Result<Catalog<'a>, Error>
Validate every parent and name, and finish the catalog.
What is checked here is what the static tables can answer on their own: that the parent
exists, that it invited runtime commands, and that no name collides. Assembling the
merged tree is left to Catalog::app — dispatching a plugin command never needs it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Builder<'a>
impl<'a> RefUnwindSafe for Builder<'a>
impl<'a> Send for Builder<'a>
impl<'a> Sync for Builder<'a>
impl<'a> Unpin for Builder<'a>
impl<'a> UnsafeUnpin for Builder<'a>
impl<'a> UnwindSafe for Builder<'a>
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> 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