pub struct SpecView<'a> { /* private fields */ }Expand description
A borrowed, sparse view over a derive-generated Spec.
Constructing a view copies no command tree and is never part of argv parsing. It exists for cold paths—help, spec emission and completion—where a program may need runtime identity or a centrally audited metadata policy without lowering the static tables through usage-lib.
Implementations§
Source§impl<'a> SpecView<'a>
impl<'a> SpecView<'a>
pub const fn new(base: &'a Spec<'a>) -> SpecView<'a>
pub fn name<'b, 'c>(self, name: &'b str) -> SpecView<'c>where
'a: 'c,
'b: 'c,
pub fn bin<'b, 'c>(self, bin: &'b str) -> SpecView<'c>where
'a: 'c,
'b: 'c,
pub fn version<'b, 'c>(self, version: &'b str) -> SpecView<'c>where
'a: 'c,
'b: 'c,
Sourcepub fn omit_version(self) -> SpecView<'a>
pub fn omit_version(self) -> SpecView<'a>
Leave the runtime version out of emitted specs and other metadata consumers.
The parser’s built-in version response is unchanged because parsing reads the base spec. This is for checked-in generated artifacts whose version is managed independently.
pub fn overlay<'b, 'c>(self, commands: &'b [CommandOverlay<'b>]) -> SpecView<'c>where
'a: 'c,
'b: 'c,
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SpecView<'a>
impl<'a> RefUnwindSafe for SpecView<'a>
impl<'a> Send for SpecView<'a>
impl<'a> Sync for SpecView<'a>
impl<'a> Unpin for SpecView<'a>
impl<'a> UnsafeUnpin for SpecView<'a>
impl<'a> UnwindSafe for SpecView<'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
Mutably borrows from an owned value. Read more