Weave documentation
Rust referenceweave-locus

weave-locus · locus

Source declarations, signatures and documentation for locus.

Reviewed implementation boundary: Rollback records a marker; mount descriptions and governance metadata alone do not execute mounting or enforce signature authorization. Operations can have separate metadata/blob failure points. See /libraries/locus/overview.

Source: sigil/weave/models/locus/src/locus.rs. SHA-256: 954352fa8fe2a85d137e2d7f46419cc12acbc61e4a4fdc687739de156f309ccf.

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.

locus::GovernanceType

Governance type for the organization

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum GovernanceType {
    /// Single human root (opaque identity string)
    HumanRoot(String),
    /// Multi-human root
    MultiHumanRoot {
        /// Root identities (opaque strings)
        roots: Vec<String>,
        /// Threshold required
        threshold: u32,
    },
}

Source line: 34.

locus::Locus

Locus distributed file system

pub struct Locus {

}

Source line: 47.

locus::Locus::new

Create a new Locus file system with identity adapter (recommended)

pub async fn new(
        metadata: Arc<Lens>,
        blobs: Arc<BlobStore>,
        config: LocusConfig,
        governance: GovernanceType,
    ) -> Result<Self>;

Source line: 76.

locus::Locus::governance

Get the governance type

pub fn governance(&self) -> &GovernanceType;

Source line: 123.

locus::Locus::write_file

Write a file

pub async fn write_file<P: AsRef<Path>>(
        &self,
        path: P,
        data: &[u8],
        options: Option<WriteOptions>,
    ) -> Result<()>;

Source line: 128.

locus::Locus::read_file

Read a file

pub async fn read_file<P: AsRef<Path>>(&self, path: P) -> Result<Vec<u8>>;

Source line: 233.

locus::Locus::mkdir

Create a directory

pub async fn mkdir<P: AsRef<Path>>(&self, path: P, options: CreateOptions) -> Result<()>;

Source line: 271.

locus::Locus::readdir

List directory contents

pub async fn readdir<P: AsRef<Path>>(&self, path: P) -> Result<Vec<String>>;

Source line: 362.

locus::Locus::remove

Remove a file or directory

pub async fn remove<P: AsRef<Path>>(&self, path: P) -> Result<()>;

Source line: 403.

locus::Locus::stat

Get file statistics

pub async fn stat<P: AsRef<Path>>(&self, path: P) -> Result<Stat>;

Source line: 450.

locus::Locus::exists

Check if a path exists

pub async fn exists<P: AsRef<Path>>(&self, path: P) -> Result<bool>;

Source line: 468.

locus::Locus::watch

Create a new watcher

pub fn watch(&self) -> Watcher;

Source line: 602.

locus::Locus::unwatch

Remove a watcher

pub fn unwatch(&self, id: WatcherId);

Source line: 609.

locus::Locus::snapshot

Create a filesystem snapshot (logical: capture root marker)

pub async fn snapshot(&self, name: Option<&str>) -> Result<uuid::Uuid>;

Source line: 614.

locus::Locus::rollback

Roll back metadata to a snapshot marker (best-effort: user-level repair uses fsck)

pub async fn rollback(&self, _id: uuid::Uuid) -> Result<()>;

Source line: 632.

locus::Locus::fsck

fsck/repair: scan metadata keys and report missing entries

pub async fn fsck(&self) -> Result<serde_json::Value>;

Source line: 647.

locus::Locus::read_file_range

Read a range from a file with offset and optional length

pub async fn read_file_range<P: AsRef<Path>>(
        &self,
        path: P,
        offset: u64,
        length: Option<u64>,
    ) -> Result<Vec<u8>>;

Source line: 658.

locus::Locus::write_file_range

Write bytes at an offset (resume support). Creates file if not exists when offset==0.

pub async fn write_file_range<P: AsRef<Path>>(
        &self,
        path: P,
        offset: u64,
        data: &[u8],
        options: Option<WriteOptions>,
    ) -> Result<()>;

Source line: 677.

locus::Locus::ingest_metadata_block

Ingest a verified remote strand block into metadata strand (delegates to underlying strand)

pub async fn ingest_metadata_block(
        &self,
        seq: u64,
        header: &strand::Header,
        data: &[u8],
    ) -> Result<()>;

Source line: 743.

locus::Locus::ingest_blob_meta_block

Ingest a verified remote strand block into blob metadata strand (delegates to blob store)

pub async fn ingest_blob_meta_block(
        &self,
        seq: u64,
        header: &strand::Header,
        data: &[u8],
    ) -> Result<()>;

Source line: 757.

locus::Locus::ingest_blob_data_block

Ingest a verified remote strand block into blob data strand (delegates to blob store)

pub async fn ingest_blob_data_block(
        &self,
        seq: u64,
        header: &strand::Header,
        data: &[u8],
    ) -> Result<()>;

Source line: 770.

locus::Locus::metadata_strand_for_replication

Get the underlying metadata strand for replication announcements.

This returns a clone of the strand wrapped for async access.

pub async fn metadata_strand_for_replication(&self) -> Arc<tokio::sync::RwLock<Strand>>;

Source line: 785.

locus::Locus::blob_metadata_strand_for_replication

Get the underlying blob metadata strand for replication announcements.

This returns a clone of the strand wrapped for sync access.

pub fn blob_metadata_strand_for_replication(&self) -> Arc<tokio::sync::RwLock<Strand>>;

Source line: 792.

locus::Locus::blob_data_strand_for_replication

Get the underlying blob data strand for replication announcements.

This returns a clone of the strand wrapped for sync access.

pub fn blob_data_strand_for_replication(&self) -> Arc<tokio::sync::RwLock<Strand>>;

Source line: 799.

On this page