Weave documentation
Rust referenceweave-lens

weave-lens · lens_policy

Source declarations, signatures and documentation for lens_policy.

Reviewed implementation boundary: The current batching helper rejects multiple operations instead of implementing atomic batch commits. Cache/compaction/retention configuration fields do not establish running background compaction. See /libraries/lens/overview.

Source: sigil/weave/models/lens/src/lens_policy.rs. SHA-256: 82399060b2d1bb2f60dbb008f0937de4eb81de55b46f9fddf30ffd934a41640d.

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")]

lens_policy::LensPolicy

Lens policy for boundary validation

#[cfg(feature = "policy-hooks")]
pub trait LensPolicy: Send + Sync + 'static {
    fn can_put(&self, key: &[u8], value: &[u8]) -> bool;
    fn can_delete(&self, key: &[u8]) -> bool;
}

Source line: 4.

lens_policy::AllowAllLensPolicy

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

Source line: 9.

lens_policy::LENS_POLICY

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

Source line: 20.

lens_policy::set_lens_policy

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

Source line: 22.

On this page