pub struct KindEntry {
pub kind: String,
pub count: usize,
pub route: String,
pub example: Option<ObjectSummary>,
}Expand description
One kind of the layer, with its address and how many objects it holds.
example carries one of the kind’s objects so that a catalogue of kinds is somewhere a
reader can go from rather than a list of words: a kind with a count and no way in is a
dead row. It is None only for a kind the index holds no object of.
use majordomus_cli::capability::builtin::entity::KindEntry;
let e: KindEntry = serde_json::from_value(serde_json::json!({
"kind": "adr",
"count": 52,
"route": "/cockpit/objects/adr",
}))
.unwrap();
assert_eq!(e.kind, "adr");
// the route is the kind's, derived — never a per-kind entry in a table of routes
assert_eq!(e.route, majordomus_cli::entity::kind_route(&e.kind));
assert!(e.example.is_none());Fields§
§kind: StringThe kind.
count: usizeHow many objects of it the index holds.
route: StringWhere its index is served.
example: Option<ObjectSummary>One of its objects, so a reader has somewhere to go.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KindEntry
impl<'de> Deserialize<'de> for KindEntry
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 KindEntry
impl JsonSchema for KindEntry
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 KindEntry
impl RefUnwindSafe for KindEntry
impl Send for KindEntry
impl Sync for KindEntry
impl Unpin for KindEntry
impl UnsafeUnpin for KindEntry
impl UnwindSafe for KindEntry
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