pub struct ProducedBy {
pub capability: String,
pub cli: Option<String>,
pub http: Option<String>,
pub mcp_tool: Option<String>,
pub mcp_resource: Option<String>,
}Expand description
Which capability answered with this document, and where that capability is projected.
The document carries its own provenance so that a reader — a person on the site, a client
over MCP — can find the same value elsewhere without anything having to enumerate the
routes. A page that listed them would be declaring them a second time, which is the
failure site-check’s registry and cli assertions exist to catch; it caught this one.
use majordomus_cli::release::model::ProducedBy;
let by = ProducedBy {
capability: "release.changelog".into(),
cli: Some("majordomus release changelog".into()),
http: Some("/api/v1/changelog".into()),
mcp_tool: None,
mcp_resource: Some("majordomus://changelog".into()),
};
let json = serde_json::to_value(&by).unwrap();
assert_eq!(json["capability"], "release.changelog");
// a surface the capability is not projected on is absent, not null
assert!(json.get("mcp_tool").is_none());
assert_eq!(ProducedBy::default().capability, "");Fields§
§capability: StringThe capability id.
cli: Option<String>The command line that renders it.
http: Option<String>The HTTP route that answers with it.
mcp_tool: Option<String>The MCP tool.
mcp_resource: Option<String>The MCP resource URI.
Trait Implementations§
Source§impl Clone for ProducedBy
impl Clone for ProducedBy
Source§fn clone(&self) -> ProducedBy
fn clone(&self) -> ProducedBy
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 ProducedBy
impl Debug for ProducedBy
Source§impl Default for ProducedBy
impl Default for ProducedBy
Source§fn default() -> ProducedBy
fn default() -> ProducedBy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProducedBy
impl<'de> Deserialize<'de> for ProducedBy
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 ProducedBy
Source§impl JsonSchema for ProducedBy
impl JsonSchema for ProducedBy
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 ProducedBy
impl PartialEq for ProducedBy
Source§fn eq(&self, other: &ProducedBy) -> bool
fn eq(&self, other: &ProducedBy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ProducedBy
impl Serialize for ProducedBy
impl StructuralPartialEq for ProducedBy
Auto Trait Implementations§
impl Freeze for ProducedBy
impl RefUnwindSafe for ProducedBy
impl Send for ProducedBy
impl Sync for ProducedBy
impl Unpin for ProducedBy
impl UnsafeUnpin for ProducedBy
impl UnwindSafe for ProducedBy
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.