pub struct KindList {
pub count: usize,
pub kinds: Vec<KindEntry>,
pub routable: usize,
pub collisions: Vec<Collision>,
}Expand description
Every kind of the layer, each with its route, and every route collision there is.
The two numbers are what scripts/ci/entity-check compares: the objects the index holds
against the objects that have an address. They are reported together, in one answer, so
that the gate asks one question instead of joining two lists and deciding for itself
what the difference means.
use majordomus_cli::capability::builtin::entity::KindList;
let healthy: KindList = serde_json::from_value(serde_json::json!({
"count": 1,
"kinds": [{ "kind": "adr", "count": 52, "route": "/cockpit/objects/adr" }],
"routable": 52,
}))
.unwrap();
let held: usize = healthy.kinds.iter().map(|k| k.count).sum();
// every object addressable, and no collision: the only state the gate accepts
assert_eq!(held, healthy.routable);
assert!(healthy.collisions.is_empty());Fields§
§count: usizeHow many kinds.
kinds: Vec<KindEntry>The kinds, in the index’s order.
routable: usizeHow many objects have a route. Every object does, unless it is in collisions.
collisions: Vec<Collision>Two objects of one kind whose identities reduce to one route, which is the only way
an object can fail to be addressable. Empty is the healthy answer and the only one
scripts/ci/entity-check accepts.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KindList
impl<'de> Deserialize<'de> for KindList
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 KindList
impl JsonSchema for KindList
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 KindList
impl RefUnwindSafe for KindList
impl Send for KindList
impl Sync for KindList
impl Unpin for KindList
impl UnsafeUnpin for KindList
impl UnwindSafe for KindList
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