pub struct CliSpec {
pub schema: String,
pub name: String,
pub version: String,
pub display_name: Option<String>,
pub build: Option<String>,
pub about: Option<String>,
pub lifecycle_output: OutputSpec,
pub commands: Vec<CommandSpec>,
}Expand description
Serializable version-one closed-world CLI registry.
Fields§
§schema: String§name: String§version: String§display_name: Option<String>Human-facing product name, distinct from the binary identity in name.
build: Option<String>Opaque build identifier (a git SHA, for example). The core only carries it; what it means is the host’s business.
about: Option<String>§lifecycle_output: OutputSpec§commands: Vec<CommandSpec>Implementations§
Source§impl CliSpec
impl CliSpec
Sourcepub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
Start a cli-spec-v1 registry.
pub fn about(self, about: impl Into<String>) -> Self
pub fn display_name(self, display_name: impl Into<String>) -> Self
Sourcepub fn build_id(self, build: impl Into<String>) -> Self
pub fn build_id(self, build: impl Into<String>) -> Self
Record an opaque build identifier. Named build_id because build()
already compiles the registry.
pub fn lifecycle_output(self, output: OutputSpec) -> Self
pub fn command(self, command: CommandSpec) -> Self
Sourcepub fn build(self) -> Result<BuiltCliSpec, CliSpecError>
pub fn build(self) -> Result<BuiltCliSpec, CliSpecError>
Validate and compile the registry.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CliSpec
impl<'de> Deserialize<'de> for CliSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for CliSpec
Auto Trait Implementations§
impl Freeze for CliSpec
impl RefUnwindSafe for CliSpec
impl Send for CliSpec
impl Sync for CliSpec
impl Unpin for CliSpec
impl UnsafeUnpin for CliSpec
impl UnwindSafe for CliSpec
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