pub struct EntityInput {
pub uri: Option<String>,
pub kind: Option<String>,
pub slug: Option<String>,
}Expand description
Which entity: by URI, or by the address it is served at.
Two spellings of one question, because two kinds of caller ask it: MCP and the API hold
the majordomus:// URI the index is keyed by, and the Cockpit’s router has a kind and
a slug out of a path. Nothing converts one form into the other at the edge — the
capability resolves either, so neither caller has to know the other’s spelling.
use majordomus_cli::capability::builtin::entity::EntityInput;
let by_route: EntityInput =
serde_json::from_value(serde_json::json!({ "kind": "adr", "slug": "adr-0056" }))
.unwrap();
assert_eq!(by_route.kind.as_deref(), Some("adr"));
assert_eq!(by_route.slug.as_deref(), Some("adr-0056"));
assert_eq!(by_route.uri, None);
// absent is a shape, not an error: which fields are required is the handler's question
assert_eq!(EntityInput::default().kind, None);Fields§
§uri: Option<String>majordomus://<kind>/<identity>. Either this, or kind and slug together.
kind: Option<String>The kind, when addressing by route.
slug: Option<String>The last segment of the entity’s route, when addressing by route.
Trait Implementations§
Source§impl BenchmarkCases for EntityInput
impl BenchmarkCases for EntityInput
Source§fn benchmark_cases(ctx: &CaseContext<'_>) -> Vec<NamedCase<Self>>
fn benchmark_cases(ctx: &CaseContext<'_>) -> Vec<NamedCase<Self>>
The cases, in a stable order. An empty list means “nothing to benchmark in this
repository”, which the coverage check reports as missing.
Source§fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
The cases as JSON, the shape every runner serialises from.
Source§impl Debug for EntityInput
impl Debug for EntityInput
Source§impl Default for EntityInput
impl Default for EntityInput
Source§fn default() -> EntityInput
fn default() -> EntityInput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EntityInput
impl<'de> Deserialize<'de> for EntityInput
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
Source§impl JsonSchema for EntityInput
impl JsonSchema for EntityInput
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 moreAuto Trait Implementations§
impl Freeze for EntityInput
impl RefUnwindSafe for EntityInput
impl Send for EntityInput
impl Sync for EntityInput
impl Unpin for EntityInput
impl UnsafeUnpin for EntityInput
impl UnwindSafe for EntityInput
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