pub struct Describe {
pub description: String,
pub version: Version,
pub stability: Stability,
pub min_dispatcher_version: Version,
pub platforms: Vec<Platform>,
pub requires_cargo_workspace: bool,
pub capabilities: Vec<CapabilityDescriptor>,
}Expand description
Plugin self-description payload.
Same shape as crate::manifest::Manifest; the two share a JSON schema.
Fields§
§description: StringOne-line summary, max 80 chars.
version: VersionPlugin semver.
stability: StabilityStability tier.
min_dispatcher_version: VersionMinimum dispatcher semver this plugin requires.
platforms: Vec<Platform>Supported operating systems.
requires_cargo_workspace: boolWhether the plugin requires a cargo workspace context.
capabilities: Vec<CapabilityDescriptor>Product capabilities contributed by this plugin.
Implementations§
Source§impl Describe
impl Describe
Sourcepub fn emit_stdout(&self) -> Result<()>
pub fn emit_stdout(&self) -> Result<()>
Print this Describe as a single line of JSON to stdout, terminated
by a newline.
§Errors
Returns Error::JsonParse if serialization fails or Error::Io
if writing to stdout fails.
Sourcepub fn handle_arg0_describe(
&self,
args: impl IntoIterator<Item = OsString>,
) -> Option<ExitCode>
pub fn handle_arg0_describe( &self, args: impl IntoIterator<Item = OsString>, ) -> Option<ExitCode>
If the first non-program argument is __describe, emit this Describe
and return Some(ExitCode::Ok). Otherwise return None so the caller
can continue with normal argument parsing.
Plugins MUST call this before their main argument parser runs to avoid clap rejecting the unknown subcommand.
§Errors
Returns Some(ExitCode::ContractViolation) if __describe is given
extra arguments, or if emitting the JSON line fails. Returns
Some(ExitCode::Ok) on the happy path.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Describe
impl<'de> Deserialize<'de> for Describe
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>,
impl Eq for Describe
impl StructuralPartialEq for Describe
Auto Trait Implementations§
impl Freeze for Describe
impl RefUnwindSafe for Describe
impl Send for Describe
impl Sync for Describe
impl Unpin for Describe
impl UnsafeUnpin for Describe
impl UnwindSafe for Describe
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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