pub struct Identity {
pub kind: IdentityKind,
pub bytes: Vec<u8>,
}Expand description
Tagged-union identity. Owned bytes, cheap to clone — payload is at
most IDENTITY_MAX_LEN = 4 KiB.
Fields§
§kind: IdentityKind§bytes: Vec<u8>Implementations§
Source§impl Identity
impl Identity
Sourcepub fn ed25519(pubkey: [u8; 32]) -> Self
pub fn ed25519(pubkey: [u8; 32]) -> Self
Convenience constructor: Ed25519 from a fixed 32-byte pubkey.
Sourcepub fn opaque(bytes: impl Into<Vec<u8>>) -> Self
pub fn opaque(bytes: impl Into<Vec<u8>>) -> Self
Convenience constructor: opaque producer-defined bytes.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Structural validity check: payload len in 1..=IDENTITY_MAX_LEN;
Ed25519 is exactly 32 bytes; a DidKey payload must be a multibase
string, i.e. all printable ASCII (no NUL/control/whitespace/high
bytes) — so a binary blob can’t be smuggled in under the DID kind.
Opaque is producer-defined and accepts any non-empty bytes.
Trait Implementations§
impl Eq for Identity
impl StructuralPartialEq for Identity
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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,
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§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more