pub struct Ppnum(/* private fields */);Expand description
Validated Ppoppo Number (≥11 digits, ASCII digits only).
Format matches PAS DB CHECK constraint ^[0-9]{11,}$. Variable
length (11/15/19/…): 11 digits = independent ppnum, 15+ digits =
dependent (sub-agent hierarchy, +4 digits per nesting level).
Wire form (this type’s Display impl) is the raw digit string
(12312345678). UI layers may render with hyphen grouping
(123-1234-5678); that formatting is the consumer’s choice and
is NOT performed by Display or as_str(). The validator also
rejects hyphenated input on parse — only the wire form is accepted.
Prefix is band-allocated and carries no semantic meaning — class
is decided by ppnums.entity_type / ppnums.number_class columns
server-side, never by leading digits (PAS Constitution Principle III).
No upper length bound is enforced; trust PAS issuance.
Guaranteed valid by construction: holding a Ppnum proves the format is correct.
Use "12312345678".parse::<Ppnum>() or Ppnum::try_from(string) to create.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ppnum
impl<'de> Deserialize<'de> for Ppnum
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Ppnum, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Ppnum, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Ppnum
impl Serialize for Ppnum
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for Ppnum
impl StructuralPartialEq for Ppnum
Auto Trait Implementations§
impl Freeze for Ppnum
impl RefUnwindSafe for Ppnum
impl Send for Ppnum
impl Sync for Ppnum
impl Unpin for Ppnum
impl UnsafeUnpin for Ppnum
impl UnwindSafe for Ppnum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.