l1fe-weave-core · crate
Source declarations, signatures and documentation for crate.
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/lib.rs. SHA-256: 7267b43b984056ceb46f2e0f824162ba2c691dfab3c0126b11d86dbd82ae32b3.
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.
pub use crate::error::{Result, WeaveError};
pub use crate::error::{Result, WeaveError};Source line: 31.
pub use crate::filesystem::AgentFs;
#[cfg(feature = "fs")]
pub use crate::filesystem::AgentFs;Source line: 33.
pub use crate::filesystem::Mirror;
pub use crate::filesystem::Mirror;Source line: 34.
pub use crate::identity::Did;
pub use crate::identity::Did;Source line: 35.
pub use crate::network::{Dht, Swarm};
#[cfg(feature = "p2p")]
pub use crate::network::{Dht, Swarm};Source line: 37.
pub use crate::storage::{Lens, Locus, Nexus};
pub use crate::storage::{Lens, Locus, Nexus};Source line: 38.
pub use basis::Basis;
pub use basis::Basis;Source line: 39.
pub use forum::Forum;
pub use forum::Forum;Source line: 40.
pub use gnosis::Gnosis;
pub use gnosis::Gnosis;Source line: 41.
pub use weave_identity;
pub use weave_identity;Source line: 47.
identity
Identity management (wraps weave-identity)
pub mod identity;Source line: 50.
storage
Storage abstractions (Strand, Locus, Lens, Nexus)
pub mod storage;Source line: 53.
network
P2P networking components
pub mod network;Source line: 56.
filesystem
Agent filesystem abstractions
pub mod filesystem;Source line: 59.
crypto
Security utilities (no key operations)
pub mod crypto;Source line: 62.
error
Error types for the Weave
pub mod error;Source line: 65.
utils
Utilities and helpers
pub mod utils;Source line: 68.
prelude
Re-exports of core types
pub mod prelude;Source line: 71.
pub use crate::crypto::{generate_nonce, hash};
pub use crate::crypto::{generate_nonce, hash};Source line: 72.
pub use crate::error::{Result, WeaveError};
pub use crate::error::{Result, WeaveError};Source line: 73.
pub use crate::filesystem::AgentFs;
#[cfg(feature = "fs")]
pub use crate::filesystem::AgentFs;Source line: 75.
pub use crate::filesystem::Mirror;
pub use crate::filesystem::Mirror;Source line: 76.
pub use crate::identity::Did;
pub use crate::identity::Did;Source line: 77.
pub use crate::network::{Dht, Swarm};
#[cfg(feature = "p2p")]
pub use crate::network::{Dht, Swarm};Source line: 79.
pub use crate::storage::strand::Strand as WeaveStrand;
pub use crate::storage::strand::Strand as WeaveStrand;Source line: 80.
pub use crate::storage::{Lens, Locus, Nexus};
pub use crate::storage::{Lens, Locus, Nexus};Source line: 81.
pub use crate::Weave;
pub use crate::Weave;Source line: 82.
pub use basis::Basis;
pub use basis::Basis;Source line: 83.
pub use forum::Forum;
pub use forum::Forum;Source line: 84.
pub use gnosis::Gnosis;
pub use gnosis::Gnosis;Source line: 85.
pub use weave_identity::{Identity as WeaveIdentity, WeaveIdentityAdapter};
pub use weave_identity::{Identity as WeaveIdentity, WeaveIdentityAdapter};Source line: 88.
::Weave
The main entry point for The Weave.
pub struct Weave {
/// The root strand for this Weave instance.
pub root_strand: Arc<RwLock<Strand>>,
/// The Forum tuple space.
pub forum: Forum,
/// The Gnosis knowledge graph.
pub gnosis: Gnosis,
/// The Basis vector store.
pub basis: Basis,
/// The identity adapter instance
pub identity_adapter: Arc<dyn weave_identity::WeaveIdentityAdapter>
}Source line: 92.
::Weave::new
Creates a new Weave instance from a root strand.
The root strand is used to derive the strands for the sub-components. For now, we are taking separate strands for each component.
pub async fn new(
root_strand: Arc<RwLock<Strand>>,
forum_strand: Arc<RwLock<Strand>>,
gnosis_strand: Arc<RwLock<Strand>>,
basis_vector_strand: Arc<RwLock<Strand>>,
basis_index_strand: Arc<RwLock<Strand>>,
identity_adapter: Arc<dyn weave_identity::WeaveIdentityAdapter>,
) -> Result<Self>;Source line: 110.
::Weave::identity
Get the identity adapter instance
pub fn identity(&self) -> &Arc<dyn weave_identity::WeaveIdentityAdapter>;Source line: 132.
::init
Initialize the Weave subsystem
pub async fn init() -> Result<()>;Source line: 138.
migration
Migration helper for legacy code
pub mod migration;Source line: 157.
migration::MigrationGuide
Convert legacy KeyPair operations to SDK operations
Example
// Old code:
let keypair = KeyPair::generate();
let signature = keypair.sign(message);
// New code:
let sdk = WeaveIdentity::new();
let (keypair, identity) = sdk.create_identity(IdentityType::Human, None).await?;
let signature = sdk.sign(&keypair, message).await?;pub struct MigrationGuide;Source line: 174.
migration::MigrationGuide::example_key_generation
Example of migrating key generation
pub async fn example_key_generation() -> Result<()>;Source line: 178.