pub struct SignalDef {
pub name: String,
pub kind: SignalKind,
pub relationships: Vec<String>,
pub direction: ReachDirection,
pub neighbour_field: Option<String>,
pub neighbour_value: Option<String>,
pub thresholds: Vec<SignalThreshold>,
}Expand description
One declared aggregate signal on a type definition. This wave
ships one kind, edge_load: count the edges of a named rel-type
set, in a named direction, on entities of this type, optionally
restricted to edges whose counterpart entity holds a named enum
value. Thresholds map counts to levels; below the first threshold
the served level is none. Values are computed at read time in
O(degree), never stored, never part of _hash; a signal may not
reference another signal, and nothing multiplies, averages, or
decays — a count and a threshold are the whole vocabulary.
Fields§
§name: StringUnique per type, [a-z][a-z0-9_]* — the stable name prose
and consumers bind guidance to.
kind: SignalKindClosed kind enum — one member in this wave.
relationships: Vec<String>Edge names the count covers (inline relation set; loader validates each against the vocabulary).
direction: ReachDirectionin counts edges pointing at the entity, out edges pointing
away — the same vocabulary the store and search speak.
neighbour_field: Option<String>Optional counterpart filter, whole or not at all: count only
edges whose counterpart entity holds neighbour_value in
neighbour_field. A counterpart lacking the field or holding
another value simply does not count.
neighbour_value: Option<String>§thresholds: Vec<SignalThreshold>Non-empty, strictly increasing at_least values.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SignalDef
impl<'de> Deserialize<'de> for SignalDef
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>,
Source§impl JsonSchema for SignalDef
impl JsonSchema for SignalDef
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more