Skip to main content

LogEntryMethods

Trait LogEntryMethods 

Source
pub trait LogEntryMethods {
    // Required methods
    fn get_version_time_string(&self) -> String;
    fn get_version_time(&self) -> DateTime<FixedOffset>;
    fn get_version_id(&self) -> &str;
    fn set_version_id(&mut self, version_id: &str);
    fn get_parameters(&self) -> Parameters;
    fn add_proof(&mut self, proof: DataIntegrityProof);
    fn get_proofs(&self) -> &[DataIntegrityProof];
    fn clear_proofs(&mut self);
    fn get_scid(&self) -> Option<&str>;
    fn get_state(&self) -> &Value;
    fn get_did_document(&self) -> Result<Value, DIDWebVHError>;
}
Expand description

Common accessors shared by all log entry versions.

Required Methods§

Source

fn get_version_time_string(&self) -> String

LogEntry Parameters versionTime

Source

fn get_version_time(&self) -> DateTime<FixedOffset>

LogEntry Parameters versionTime

Source

fn get_version_id(&self) -> &str

Returns the versionId for this log entry.

Source

fn set_version_id(&mut self, version_id: &str)

Set the versionId to an updated value.

Source

fn get_parameters(&self) -> Parameters

Get Parameters

Source

fn add_proof(&mut self, proof: DataIntegrityProof)

Add a proof for this log entry.

Source

fn get_proofs(&self) -> &[DataIntegrityProof]

Get proofs for this log entry.

Source

fn clear_proofs(&mut self)

Resets all proofs for this LogEntry

Source

fn get_scid(&self) -> Option<&str>

Returns the SCID if present in this log entry’s parameters.

Source

fn get_state(&self) -> &Value

Get the raw DID Document state Does NOT include implied services

Source

fn get_did_document(&self) -> Result<Value, DIDWebVHError>

Returns a full DID Document including implied services (#files / #whois).

This builds a fresh Value by cloning state and appending any missing implicit services — the LogEntry itself is not mutated. The returned document is for resolution / display only.

§⚠ DO NOT feed this back into create_log_entry or update

The hash chain (versionId, SCID, eddsa-jcs-2022 proofs) is computed over the LogEntry’s stored state, which by spec excludes the implicit services. Passing the augmented document from get_did_document() as the new state would bake #files and #whois into the canonical bytes, breaking interop with every other didwebvh implementation. If you need the document for an update, use get_state instead.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§