Weave documentation
Rust referenceweave-locus

weave-locus · policy

Source declarations, signatures and documentation for policy.

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/policy.rs. SHA-256: 8365ff587a3dc32b6c053ae97d5330fc14109f2798943cd05139ebb83594c78f.

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.

Module condition:

#[cfg(feature = "policy-hooks")]

policy::LocusPolicy

#[cfg(feature = "policy-hooks")]
pub trait LocusPolicy: Send + Sync + 'static {
    fn before_write_file(&self, path: &str, size: u64) -> bool;
    fn before_delete(&self, path: &str) -> bool;
    fn before_mkdir(&self, path: &str) -> bool;
}

Source line: 3.

policy::AllowAllLocusPolicy

#[cfg(feature = "policy-hooks")]
pub struct AllowAllLocusPolicy;

Source line: 9.

policy::LOCUS_POLICY

#[cfg(feature = "policy-hooks")]
pub static LOCUS_POLICY: OnceCell<Box<dyn LocusPolicy>>;

Source line: 23.

policy::set_locus_policy

#[cfg(feature = "policy-hooks")]
pub fn set_locus_policy(policy: Box<dyn LocusPolicy>) -> Result<(), Box<dyn LocusPolicy>>;

Source line: 25.

On this page