Weave documentation
Rust referencel1fe-weave-core

l1fe-weave-core · storage::locus

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

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/locus.rs. SHA-256: 3792b5c2f99d84176aa10b54827ede4bca20d4d1157a4a3964444e8e9bddc196.

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::locus::LocusMetadata

File metadata

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LocusMetadata {
/// File/directory name

pub name: String,
/// Size in bytes

pub size: u64,
/// MIME type

pub mime_type: String,
/// Creation time

pub created_at: DateTime<Utc>,
/// Modification time

pub modified_at: DateTime<Utc>,
/// Owner DID

pub owner: Did,
/// Permissions

pub permissions: u32,
/// Whether this is a directory

pub is_directory: bool
}

Source line: 18.

storage::locus::LocusFile

File in Locus

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LocusFile {
/// Metadata

pub metadata: LocusMetadata,
/// Content strand DID

pub content_strand: String
}

Source line: 39.

storage::locus::LocusDirectory

Directory in Locus

#[derive(Debug, Clone)]
pub struct LocusDirectory {
/// Metadata

pub metadata: LocusMetadata,
/// Child entries (name -> DID)

pub children: DashMap<String, String>
}

Source line: 48.

storage::locus::Locus

Locus file system

pub struct Locus {

}

Source line: 56.

storage::locus::Locus::create

Create a new Locus drive

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

Source line: 73.

storage::locus::Locus::open

Open an existing Locus drive (read-only by default)

pub fn open(did: String, owner: Did, root: LocusDirectory, lens: Arc<Lens>) -> Self;

Source line: 109.

storage::locus::Locus::enable_write_access

Enable write access (must have appropriate credentials in SDK)

pub fn enable_write_access(&mut self);

Source line: 124.

storage::locus::Locus::did

Get the Locus DID

pub fn did(&self) -> &str;

Source line: 129.

storage::locus::Locus::owner

Get the owner DID

pub fn owner(&self) -> &Did;

Source line: 134.

storage::locus::Locus::mkdir

Create a directory

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

Source line: 139.

storage::locus::Locus::write_file

Write a file

pub async fn write_file(&self, path: &Path, content: Vec<u8>, mime_type: &str) -> Result<()>;

Source line: 187.

storage::locus::Locus::read_file

Read a file

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

Source line: 259.

storage::locus::Locus::list_dir

List directory contents

pub async fn list_dir(&self, path: &Path) -> Result<Vec<LocusMetadata>>;

Source line: 287.

storage::locus::Locus::stat

Get file/directory metadata

pub fn stat(&self, path: &Path) -> Result<LocusMetadata>;

Source line: 336.

On this page