pub enum EntityType {
Human,
Enterprise,
AiAgent,
Programmable,
Mask,
}Expand description
What kind of entity a ppnum is.
Members are exactly the storable values of
scaccounts.ppnums.entity_type (ck_ppnums_entity_type_enum) — bound to
that constraint by the enrollment directly below, so the constraint name
lives on the fact.
There is no non_stored list, and that is the point: every member of
this vocabulary is a real, storable entity kind. The render-only
Delegated that the retired PAS enum had to declare as an exception is not
an exception here — it is simply not an entity type. See the module docs.
The serde impls are feature-gated and off by default (PCS caches
PpnumAccount as JSON in KVRocks and needs them; the only other consumer is
PAS’s AdminLayer1 cache value, which carries a LifecycleState). The
wire form is rename_all = "snake_case" — byte-identical to
as_str, and not by coincidence: snake_case of each
variant is the canonical string, so the derive cannot drift from
TABLE. If a variant ever needs a form snake_case does not produce,
delete the derive and write a manual impl that delegates to as_str — a
second spelling of the wire strings is precisely the mirror this crate
exists to remove.
Variants§
Human
Natural person. Also the class of a token whose sub is a human
being driven by an agent (ppnum lending) — the agent is act, not a
different entity type.
Enterprise
Business or organization.
AiAgent
LLM-backed agent holding its own ppnum.
Programmable
Developer-programmable number (template / auto-reply). Infra class.
Mask
Ephemeral privacy-mediation proxy number with a TTL. Industry analogue: Twilio Masking Numbers / 안심번호.
Implementations§
Source§impl EntityType
impl EntityType
Sourcepub const ALL: [EntityType; 5]
pub const ALL: [EntityType; 5]
Every variant. Ordered as TABLE.
Sourcepub const fn facts(self) -> &'static EntityFacts
pub const fn facts(self) -> &'static EntityFacts
This variant’s row. Every attribute accessor below reads through it,
so TABLE is the only place an attribute is stated.
Sourcepub const fn can_hold_credential(self) -> bool
pub const fn can_hold_credential(self) -> bool
May this entity hold a minted credential? See
EntityFacts::can_hold_credential.
Sourcepub const fn requires_ai_disclosure(self) -> bool
pub const fn requires_ai_disclosure(self) -> bool
Does this entity carry an AI-disclosure obligation? See
EntityFacts::requires_ai_disclosure.
Sourcepub fn parse(s: &str) -> Option<EntityType>
pub fn parse(s: &str) -> Option<EntityType>
Parse a canonical wire string. Exact inverse of
as_str.
None for anything outside the vocabulary — notably "delegated",
which is a session mode and never an entity type. Callers on a
verify path MUST treat None as a forgery signal, not as an
unknown-but-tolerable value.
Trait Implementations§
Source§impl Clone for EntityType
impl Clone for EntityType
Source§fn clone(&self) -> EntityType
fn clone(&self) -> EntityType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EntityType
Source§impl Debug for EntityType
impl Debug for EntityType
Source§impl Display for EntityType
impl Display for EntityType
impl Eq for EntityType
Source§impl Hash for EntityType
impl Hash for EntityType
Source§impl Ord for EntityType
impl Ord for EntityType
Source§fn cmp(&self, other: &EntityType) -> Ordering
fn cmp(&self, other: &EntityType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for EntityType
impl PartialEq for EntityType
Source§impl PartialOrd for EntityType
impl PartialOrd for EntityType
Source§impl SchemaConstrained for EntityType
impl SchemaConstrained for EntityType
Source§const ALL: &'static [EntityType]
const ALL: &'static [EntityType]
strum);
the exhaustiveness guard makes an omission a build error and the DB test
makes a stale list a pre-flight failure.Source§const CHECK_CONSTRAINTS: &'static [&'static str]
const CHECK_CONSTRAINTS: &'static [&'static str]
CHECK constraint(s) whose IN (…) set must equal
{ ALL.map(db_value) }. More than one when several columns share the
value-set (e.g. lifecycle_state on three columns).Source§fn db_value(&self) -> &'static str
fn db_value(&self) -> &'static str
CHECK. Delegates to the enum’s inherent as_str /
as_wire.Source§fn bindings() -> Vec<SchemaBinding>
fn bindings() -> Vec<SchemaBinding>
(constraint, allowed) pairs for the drift test — one per entry
in CHECK_CONSTRAINTS.