pub struct VcAttributes {
pub did_hash: u64,
pub roles: [u64; 8],
pub role_count: u8,
pub clearance_level: u8,
pub credential_issuer: u64,
}Expand description
Parsed Verifiable Credential attributes for a single agent.
Extracted from the agent’s NQuin slice via VcAttributes::from_quins().
Fields§
§did_hash: u64§roles: [u64; 8]§role_count: u8§clearance_level: u8Numeric clearance level (0=public … 4=fiduciary). Sourced from vc:clearanceLevel.
credential_issuer: u64Hash of the VC issuer’s DID — must be in the trusted-issuer set.
Implementations§
Source§impl VcAttributes
impl VcAttributes
Sourcepub fn unauthenticated(did_hash: u64) -> Self
pub fn unauthenticated(did_hash: u64) -> Self
Create a minimal VcAttributes for did_hash with no claims.
Sourcepub fn from_quins(agent_did: u64, quins: &[NQuin]) -> Self
pub fn from_quins(agent_did: u64, quins: &[NQuin]) -> Self
Parse VC claims for agent_did from a slice of NQuins.
Scans for quins where subject == agent_did and predicate is one of
P_HAS_ROLE, P_CLEARANCE_LEVEL, or P_ISSUED_BY.
Trait Implementations§
Source§impl Clone for VcAttributes
impl Clone for VcAttributes
Source§fn clone(&self) -> VcAttributes
fn clone(&self) -> VcAttributes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VcAttributes
impl Debug for VcAttributes
impl Copy for VcAttributes
Auto Trait Implementations§
impl Freeze for VcAttributes
impl RefUnwindSafe for VcAttributes
impl Send for VcAttributes
impl Sync for VcAttributes
impl Unpin for VcAttributes
impl UnsafeUnpin for VcAttributes
impl UnwindSafe for VcAttributes
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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