pub struct DocAt {
pub commit: Oid,
pub blob: Oid,
pub doc: Doc,
}
Expand description
A verified identity document at a specific commit.
Fields§
§commit: Oid
The commit at which this document exists.
blob: Oid
The document blob at this commit.
doc: Doc
The parsed document.
Methods from Deref<Target = Doc>§
Sourcepub fn payload(&self) -> &BTreeMap<PayloadId, Payload>
pub fn payload(&self) -> &BTreeMap<PayloadId, Payload>
Return the associated payloads for this Doc
.
Sourcepub fn project(&self) -> Result<Project, PayloadError>
pub fn project(&self) -> Result<Project, PayloadError>
Get the project payload, if it exists and is valid, out of this document.
pub fn default_branch_rule( &self, ) -> Result<(Pattern, Rule<ResolvedDelegates, Threshold>), DefaultBranchRuleError>
Sourcepub fn visibility(&self) -> &Visibility
pub fn visibility(&self) -> &Visibility
Return the associated Visibility
of this document.
Sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Check whether the visibility of the document is private.
Sourcepub fn threshold_nonzero(&self) -> &NonZero<usize>
pub fn threshold_nonzero(&self) -> &NonZero<usize>
Return the associated threshold of this document in its non-zero format.
Sourcepub fn is_delegate(&self, did: &Did) -> bool
pub fn is_delegate(&self, did: &Did) -> bool
Check if the did
is part of the Doc::delegates
set.
Sourcepub fn is_visible_to(&self, did: &Did) -> bool
pub fn is_visible_to(&self, did: &Did) -> bool
Check whether this document and the associated repository is visible to the given peer.
Sourcepub fn verify_signature(
&self,
key: &PublicKey,
signature: &Signature,
blob: Oid,
) -> Result<(), PublicKey>
pub fn verify_signature( &self, key: &PublicKey, signature: &Signature, blob: Oid, ) -> Result<(), PublicKey>
Validate signature
using this document’s delegates, against a given
document blob.
Sourcepub fn is_majority(&self, votes: usize) -> bool
pub fn is_majority(&self, votes: usize) -> bool
Check the provided votes
passes the Doc::majority
.
Sourcepub fn majority(&self) -> usize
pub fn majority(&self) -> usize
Return the majority number based on the size of the delegates set.
Sourcepub fn sign<G>(&self, signer: &G) -> Result<(Oid, Vec<u8>, Signature), DocError>
pub fn sign<G>(&self, signer: &G) -> Result<(Oid, Vec<u8>, Signature), DocError>
Doc::encode
and sign the Doc
, returning the set of bytes, its
corresponding Git Oid
and the Signature
over the Oid
.
Sourcepub fn init<G>(
&self,
repo: &Repository,
signer: &Device<G>,
) -> Result<Oid, RepositoryError>
pub fn init<G>( &self, repo: &Repository, signer: &Device<G>, ) -> Result<Oid, RepositoryError>
Initialize an identity::Identity
with this Doc
as the associated
document.
Trait Implementations§
impl Eq for DocAt
impl StructuralPartialEq for DocAt
Auto Trait Implementations§
impl Freeze for DocAt
impl RefUnwindSafe for DocAt
impl Send for DocAt
impl Sync for DocAt
impl Unpin for DocAt
impl UnwindSafe for DocAt
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<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
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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