pub struct ToolSpec { /* private fields */ }Expand description
Shared metadata for a CLI binary.
Implementations§
Source§impl ToolSpec
impl ToolSpec
Sourcepub const fn new(
bin_name: &'static str,
display_name: &'static str,
version: &'static str,
license: LicenseType,
repo: RepoInfo,
supports_json: bool,
supports_doctor: bool,
) -> ToolSpec
pub const fn new( bin_name: &'static str, display_name: &'static str, version: &'static str, license: LicenseType, repo: RepoInfo, supports_json: bool, supports_doctor: bool, ) -> ToolSpec
Create a new ToolSpec.
Sourcepub const fn workspace(
bin_name: &'static str,
display_name: &'static str,
version: &'static str,
license: LicenseType,
supports_json: bool,
supports_doctor: bool,
) -> ToolSpec
pub const fn workspace( bin_name: &'static str, display_name: &'static str, version: &'static str, license: LicenseType, supports_json: bool, supports_doctor: bool, ) -> ToolSpec
Create a new ToolSpec using WORKSPACE_REPO.
Sourcepub const fn with_agent_surface(
self,
agent_surface: &'static AgentSurfaceSpec,
) -> ToolSpec
pub const fn with_agent_surface( self, agent_surface: &'static AgentSurfaceSpec, ) -> ToolSpec
Attach an agent surface to the tool specification.
Sourcepub const fn display_name(&self) -> &'static str
pub const fn display_name(&self) -> &'static str
Return the human-readable tool name.
Sourcepub const fn agent_surface(&self) -> Option<&'static AgentSurfaceSpec>
pub const fn agent_surface(&self) -> Option<&'static AgentSurfaceSpec>
Return the agent surface, if configured.
Sourcepub const fn supports_json(&self) -> bool
pub const fn supports_json(&self) -> bool
Whether the tool supports JSON output in base commands.
Sourcepub const fn supports_doctor(&self) -> bool
pub const fn supports_doctor(&self) -> bool
Whether the tool exposes doctor checks.
Whether the tool has opted into the authoritative shared CLI contract.
Validate that the tool uses the authoritative shared CLI contract.
§Errors
Returns ContractError::NotAuthoritative when the tool still relies on
legacy advisory flags.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolSpec
impl RefUnwindSafe for ToolSpec
impl Send for ToolSpec
impl Sync for ToolSpec
impl Unpin for ToolSpec
impl UnsafeUnpin for ToolSpec
impl UnwindSafe for ToolSpec
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