pub struct TrustPolicy {
pub trusted_domains: HashSet<String>,
pub accept_unknown: bool,
}Expand description
Decides whether a peer DID is trusted: its did:web or did:webvh name must
be allowed, or accept_unknown is set. The name is the domain plus any
path, colon-joined (did:web:a.example:agents is a.example:agents), so a
bare-domain entry trusts the bare domain only and a path is trusted only
when the policy names it.
Fields§
§trusted_domains: HashSet<String>§accept_unknown: boolImplementations§
Source§impl TrustPolicy
impl TrustPolicy
pub fn new( domains: impl IntoIterator<Item = String>, accept_unknown: bool, ) -> Self
pub fn is_trusted(&self, did: &str) -> bool
Trait Implementations§
Source§impl Clone for TrustPolicy
impl Clone for TrustPolicy
Source§impl Debug for TrustPolicy
impl Debug for TrustPolicy
Auto Trait Implementations§
impl Forget for TrustPolicy
impl Freeze for TrustPolicy
impl Move for TrustPolicy
impl RefUnwindSafe for TrustPolicy
impl Send for TrustPolicy
impl Sync for TrustPolicy
impl Unpin for TrustPolicy
impl UnsafeUnpin for TrustPolicy
impl UnwindSafe for TrustPolicy
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