pub struct Prefix(/* private fields */);Expand description
Strongly-typed KERI identifier prefix (e.g., "ETest123...", "DKey456...").
A prefix is the autonomous identifier (AID) for a KERI identity. For
self-addressing AIDs it starts with E (Blake3-256 digest of the inception
event); for key-based AIDs it starts with D (Ed25519 public key) or
another CESR derivation code.
Args:
- Inner
Stringmust start with a valid CESR derivation code (uppercase letter or digit). Enforced bynew(), not by serde.
Usage:
ⓘ
let prefix = Prefix::new("ETest123abc".to_string())?;
assert_eq!(prefix.as_str(), "ETest123abc");Implementations§
Source§impl Prefix
impl Prefix
Sourcepub fn new(s: String) -> Result<Prefix, KeriTypeError>
pub fn new(s: String) -> Result<Prefix, KeriTypeError>
Validates and wraps a KERI prefix string.
Accepts any valid CESR derivation code (D for Ed25519, E for Blake3,
1 for secp256k1, etc.). See [validate_prefix_derivation_code] for details.
Sourcepub fn new_unchecked(s: String) -> Prefix
pub fn new_unchecked(s: String) -> Prefix
Wraps a prefix string without validation (for trusted internal paths).
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes self and returns the inner String.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Prefix
impl<'de> Deserialize<'de> for Prefix
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Prefix, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Prefix, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Prefix
Source§impl Serialize for Prefix
impl Serialize for Prefix
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,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Prefix
Auto Trait Implementations§
impl Freeze for Prefix
impl RefUnwindSafe for Prefix
impl Send for Prefix
impl Sync for Prefix
impl Unpin for Prefix
impl UnsafeUnpin for Prefix
impl UnwindSafe for Prefix
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.