weave-nexus · nexus
Source declarations, signatures and documentation for nexus.
Source: sigil/weave/models/nexus/src/nexus.rs. SHA-256: b6cb97338bbc568b6e325aaae9e83bec46fea2c266e7549a90e1105a048d6404.
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.
nexus::NexusEvent
Events emitted by Nexus
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum NexusEvent {
/// New strand added
StrandAdded { writer_key: String },
/// Strand removed
StrandRemoved { writer_key: String },
/// View updated
ViewUpdated {
entries_added: usize,
total_entries: usize,
},
/// Error occurred
Error { message: String },
}Source line: 26.
nexus::Nexus
Multi-source view aggregator
pub struct Nexus {
}Source line: 44.
nexus::Nexus::new
Create a new nexus for aggregating views with identity adapter (recommended)
pub async fn new(
viewing_node: String,
ordering_strategy: Box<dyn OrderingStrategy>,
config: NexusConfig,
) -> Result<Self>;Source line: 73.
nexus::Nexus::viewing_node
Return the viewing node identifier
pub fn viewing_node(&self) -> &str;Source line: 99.
nexus::Nexus::add_input_strand
Add an agent's strand as input source
pub async fn add_input_strand(&self, strand: Arc<Strand>) -> Result<()>;Source line: 104.
nexus::Nexus::with_policy
Install a policy hook prior to use
pub fn with_policy(mut self, policy: Arc<dyn crate::governance::NexusPolicy>) -> Self;Source line: 144.
nexus::Nexus::paginate
Paginate the current view
pub fn paginate(&self, cursor: Option<NexusCursor>, limit: usize) -> Page;Source line: 150.
nexus::Nexus::enable_strand_view_sink
Configure a Strand-backed view sink
pub async fn enable_strand_view_sink(
&self,
strand: Arc<tokio::sync::Mutex<Strand>>,
) -> Result<()>;Source line: 156.
nexus::Nexus::remove_input_strand
Remove an input strand
pub async fn remove_input_strand(&self, writer_key: &str) -> Result<()>;Source line: 168.
nexus::Nexus::generate_view
Generate linearized view from all input strands
pub async fn generate_view(&self) -> Result<Vec<ViewEntry>>;Source line: 266.
nexus::Nexus::update_view
Update view incrementally
pub async fn update_view(&self) -> Result<()>;Source line: 337.
nexus::Nexus::current_view
Get current view
pub fn current_view(&self) -> Vec<ViewEntry>;Source line: 349.
nexus::Nexus::view_range
Get view range
pub fn view_range(&self, start: usize, end: usize) -> Vec<ViewEntry>;Source line: 354.
nexus::Nexus::stats
Get statistics about input strands
pub async fn stats(&self) -> Result<Vec<StrandStats>>;Source line: 359.
nexus::Nexus::subscribe
Subscribe to events
pub fn subscribe(&self) -> broadcast::Receiver<NexusEvent>;Source line: 370.
nexus::Nexus::get_agent_count_for_org
Get the number of agents from a specific organization
pub fn get_agent_count_for_org(&self, org_did: &str) -> usize;Source line: 375.
nexus::Nexus::shutdown
Shutdown the nexus
pub async fn shutdown(&self) -> Result<()>;Source line: 532.