pub trait Chain {
// Required methods
fn len(&self) -> usize;
fn level(&self, did: &str) -> Option<usize>;
fn root(&self) -> &str;
fn leaf(&self) -> &str;
fn upstream(&self, did: &str) -> Option<&String>;
fn downstream(&self, did: &str) -> Option<&String>;
fn data(&self, did: &str) -> Option<&(Document, DocumentMetadata)>;
fn verify_proofs(&self) -> Result<(), ChainError>;
fn level_vec(&self) -> &Vec<String>;
// Provided methods
fn to_vec(&self) -> Vec<(Document, DocumentMetadata)> { ... }
fn is_empty(&self) -> bool { ... }
}
Expand description
A chain of DIDs.
Required Methods§
Sourcefn downstream(&self, did: &str) -> Option<&String>
fn downstream(&self, did: &str) -> Option<&String>
Gets the next downstream DID.
Sourcefn data(&self, did: &str) -> Option<&(Document, DocumentMetadata)>
fn data(&self, did: &str) -> Option<&(Document, DocumentMetadata)>
Gets data for the given DID.
Sourcefn verify_proofs(&self) -> Result<(), ChainError>
fn verify_proofs(&self) -> Result<(), ChainError>
Verify all of the proofs in the chain.
Provided Methods§
Sourcefn to_vec(&self) -> Vec<(Document, DocumentMetadata)>
fn to_vec(&self) -> Vec<(Document, DocumentMetadata)>
Returns a vector of Documents and Document Metadata for each DID ordered by the level in the chain, starting at the root (level 0).