pub struct ProviderLifecycles {
pub providers: Vec<ProviderLifecycle>,
pub with_lifecycle: usize,
pub findings: Vec<String>,
}Expand description
Every provider the distribution ships a bootstrap for, with the lifecycle half of each.
with_lifecycle is a count over providers rather than a second list, so the two
cannot disagree; it is there because “how many of the providers we support actually get
the automation” is the question this capability exists to answer, and a reader should not
have to fold the list to find out.
use majordomus_cli::capability::builtin::lifecycle::ProviderLifecycles;
use serde_json::json;
let p: ProviderLifecycles = serde_json::from_value(json!({
"providers": [
{"id": "claude", "title": "Claude Code", "lifecycle": ["SessionStart"],
"prompt_capture": true, "note": "adapted"},
{"id": "plain", "title": "Plain", "prompt_capture": false, "note": "not adapted"},
],
"with_lifecycle": 1,
})).unwrap();
// the count is over the list, so it is checkable against it
let counted = p.providers.iter().filter(|x| !x.lifecycle.is_empty()).count();
assert_eq!(p.with_lifecycle, counted);
assert_eq!(p.providers.len(), 2, "a provider with no adapter is still reported");
assert!(p.findings.is_empty());Fields§
§providers: Vec<ProviderLifecycle>The providers, in declaration order.
with_lifecycle: usizeHow many of them declare a lifecycle adapter.
findings: Vec<String>What a reader should know: a provider this repository wires but the distribution declares no lifecycle for, and the like.
Trait Implementations§
Source§impl Clone for ProviderLifecycles
impl Clone for ProviderLifecycles
Source§fn clone(&self) -> ProviderLifecycles
fn clone(&self) -> ProviderLifecycles
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderLifecycles
impl Debug for ProviderLifecycles
Source§impl<'de> Deserialize<'de> for ProviderLifecycles
impl<'de> Deserialize<'de> for ProviderLifecycles
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 Eq for ProviderLifecycles
Source§impl JsonSchema for ProviderLifecycles
impl JsonSchema for ProviderLifecycles
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ProviderLifecycles
impl PartialEq for ProviderLifecycles
Source§fn eq(&self, other: &ProviderLifecycles) -> bool
fn eq(&self, other: &ProviderLifecycles) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ProviderLifecycles
impl Serialize for ProviderLifecycles
impl StructuralPartialEq for ProviderLifecycles
Auto Trait Implementations§
impl Freeze for ProviderLifecycles
impl RefUnwindSafe for ProviderLifecycles
impl Send for ProviderLifecycles
impl Sync for ProviderLifecycles
impl Unpin for ProviderLifecycles
impl UnsafeUnpin for ProviderLifecycles
impl UnwindSafe for ProviderLifecycles
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.