Skip to main content

EntityType

Enum EntityType 

Source
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

Source

pub const ALL: [EntityType; 5]

Every variant. Ordered as TABLE.

Source

pub const fn index(self) -> usize

Stable position in ALL / TABLE.

The exhaustive match is the compile-time gate: a sixth variant fails to build here, so it cannot reach a claim by defaulting.

Source

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.

Source

pub const fn as_str(self) -> &'static str

Canonical wire/DB string.

Source

pub const fn can_hold_credential(self) -> bool

May this entity hold a minted credential? See EntityFacts::can_hold_credential.

Source

pub const fn requires_ai_disclosure(self) -> bool

Does this entity carry an AI-disclosure obligation? See EntityFacts::requires_ai_disclosure.

Source

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

Source§

fn clone(&self) -> EntityType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EntityType

Source§

impl Debug for EntityType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for EntityType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for EntityType

Source§

impl Hash for EntityType

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for EntityType

Source§

fn cmp(&self, other: &EntityType) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for EntityType

Source§

fn eq(&self, other: &EntityType) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for EntityType

Source§

fn partial_cmp(&self, other: &EntityType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl SchemaConstrained for EntityType

Source§

const ALL: &'static [EntityType]

Every variant, in any order. The macro hand-lists these (no 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]

The 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

The DB-text form of a variant — the literal stored in the column and named in the CHECK. Delegates to the enum’s inherent as_str / as_wire.
Source§

fn bindings() -> Vec<SchemaBinding>

Erased (constraint, allowed) pairs for the drift test — one per entry in CHECK_CONSTRAINTS.
Source§

impl StructuralPartialEq for EntityType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more