Weave documentation
Rust referencel1fe-weave-core

l1fe-weave-core · storage::strand

Source declarations, signatures and documentation for storage::strand.

Reviewed implementation boundary: Some core wrappers derive transport keys from DID strings. Do not infer secret key custody or authenticated peers from a supplied DID string; inspect the chosen wrapper and transport configuration. See /libraries/weave-core/overview.

Source: sigil/weave/libs/weave-core/src/storage/strand.rs. SHA-256: 24f006a85d0a3afb883a3f8b2a369f8030f5e0077ef2fb8478382adff4eb7a23.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

storage::strand::StrandEntry

Entry in a strand log

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StrandEntry {
/// Entry index

pub index: u64,
/// Entry data

pub data: Vec<u8>,
/// Timestamp

pub timestamp: DateTime<Utc>,
/// Hash of this entry

pub hash: [u8; 32],
/// Hash of previous entry

pub prev_hash: [u8; 32],
/// Signature by the strand owner

pub signature: Vec<u8>
}

Source line: 14.

storage::strand::StrandMetadata

Strand metadata

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StrandMetadata {
/// Strand DID

pub did: String,
/// Owner DID

pub owner: Did,
/// Creation timestamp

pub created_at: DateTime<Utc>,
/// Last update timestamp

pub updated_at: DateTime<Utc>,
/// Number of entries

pub length: u64,
/// Root hash

pub root_hash: [u8; 32]
}

Source line: 31.

storage::strand::Strand

Strand - An immutable append-only log

pub struct Strand {

}

Source line: 47.

storage::strand::Strand::create

Create a new strand

pub fn create(owner: Did, adapter: Arc<dyn WeaveIdentityAdapter>) -> Self;

Source line: 60.

storage::strand::Strand::open

Open an existing strand (read-only)

pub fn open(
        metadata: StrandMetadata,
        entries: Vec<StrandEntry>,
        adapter: Arc<dyn WeaveIdentityAdapter>,
    ) -> Self;

Source line: 85.

storage::strand::Strand::metadata

Get strand metadata

pub fn metadata(&self) -> StrandMetadata;

Source line: 99.

storage::strand::Strand::did

Get the strand DID

pub fn did(&self) -> String;

Source line: 104.

storage::strand::Strand::append

Append a new entry to the strand

pub async fn append(&mut self, data: Vec<u8>) -> Result<StrandEntry>;

Source line: 109.

storage::strand::Strand::verify

Verify all entries in the strand

pub async fn verify(&self) -> Result<bool>;

Source line: 156.

storage::strand::Strand::get

Get entry by index

pub fn get(&self, index: u64) -> Option<StrandEntry>;

Source line: 212.

storage::strand::Strand::entries

Get all entries

pub fn entries(&self) -> Vec<StrandEntry>;

Source line: 218.

storage::strand::Strand::len

Get the length of the strand

pub fn len(&self) -> u64;

Source line: 223.

storage::strand::Strand::is_empty

Check if the strand is empty

pub fn is_empty(&self) -> bool;

Source line: 228.

On this page