Weave documentation
Rust referenceweave-gnosis

weave-gnosis · crate

Source declarations, signatures and documentation for crate.

Reviewed implementation boundary: Construction starts empty derived indexes without automatic event replay. Read /libraries/gnosis/overview before assuming restart or remote-update projection recovery.

Source: sigil/weave/models/gnosis/src/lib.rs. SHA-256: eb8f4c90db164bd77dc063fff34ea7306438b9c03396838fea0bf345d58ed8ae.

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.

::GnosisError

Error types for Gnosis operations.

#[derive(Debug, Error)]
pub enum GnosisError {
    /// The underlying strand storage returned an error.
    #[error("Strand error: {0}")]
    Strand(String),
    /// Serialization or deserialization failed.
    #[error("Serialization error: {0}")]
    Serialization(#[from] serde_json::Error),
}

Source line: 22.

::Result

A result type for Gnosis operations.

pub type Result<T> = std::result::Result<T, GnosisError>;

Source line: 32.

::Triple

Represents a (subject, predicate, object) triple in the knowledge graph.

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Triple {
pub subject: String,
pub predicate: String,
pub object: String
}

Source line: 36.

::QueryPattern

A pattern for querying the knowledge graph.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct QueryPattern {
pub subject: Option<String>,
pub predicate: Option<String>,
pub object: Option<String>
}

Source line: 44.

::Gnosis

The Gnosis, a distributed knowledge graph.

pub struct Gnosis {

}

Source line: 51.

::Gnosis::new

Creates a new Gnosis instance.

pub fn new(strand: Arc<RwLock<Strand>>) -> Self;

Source line: 64.

::Gnosis::add_triple

Adds a triple to the knowledge graph.

pub async fn add_triple(&self, subject: &str, predicate: &str, object: &str) -> Result<()>;

Source line: 74.

::Gnosis::query

Queries the graph for triples matching a pattern using indices.

pub async fn query(&self, pattern: &QueryPattern) -> Result<Vec<Triple>>;

Source line: 106.

::Gnosis::get_neighbors

Gets the neighbors of a given node.

pub async fn get_neighbors(&self, node_id: &str) -> Result<Vec<(String, String)>>;

Source line: 175.

On this page