pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
pub fn new(root_node_ids: Vec<String>) -> Result<Self>
Sourcepub fn with_fixed_connections(
root_node_ids: Vec<String>,
load_fixed_connections: bool,
) -> Result<Self>
pub fn with_fixed_connections( root_node_ids: Vec<String>, load_fixed_connections: bool, ) -> Result<Self>
Creates Kweb context with optional legacy full fixed-node loading.
pub fn root_node_ids(&self) -> &[String]
pub fn loaded_node_ids(&self) -> &[String]
pub fn fixed_node_ids(&self) -> &[String]
pub const fn loads_fixed_connections(&self) -> bool
pub fn full_node_ids(&self) -> Vec<&str>
pub fn contains_full_node(&self, id: &str) -> bool
pub fn node(&self, id: &str) -> Option<&Node>
pub fn apply_load( &mut self, requested: Node, fixed: Vec<Node>, ) -> Result<LoadReport>
pub fn refresh(&mut self, nodes: impl IntoIterator<Item = Node>) -> Result<()>
pub fn restore( &mut self, nodes: impl IntoIterator<Item = Node>, directly_loaded: Vec<String>, ) -> Result<()>
Sourcepub fn projection(
&self,
updates: &BTreeMap<String, NodeDraft>,
creates: &[StagedCreate],
) -> Result<Vec<ProjectionItem>>
pub fn projection( &self, updates: &BTreeMap<String, NodeDraft>, creates: &[StagedCreate], ) -> Result<Vec<ProjectionItem>>
Renders the complete current Kweb projection without touching Chatend.
Full nodes and individual connection summaries have independent stable keys so ordinary replaceable-state consumers can update only values whose rendered content changed.
Sourcepub fn sync_chatend(
&self,
journal: &mut HistorySession,
recorded_at: impl Into<String>,
updates: &BTreeMap<String, NodeDraft>,
creates: &[StagedCreate],
) -> Result<Vec<BoxId>>
pub fn sync_chatend( &self, journal: &mut HistorySession, recorded_at: impl Into<String>, updates: &BTreeMap<String, NodeDraft>, creates: &[StagedCreate], ) -> Result<Vec<BoxId>>
Reconcile this context’s complete provider-facing projection through an already-open durable Session History handle.
The returned IDs are the active Kweb boxes whose name or canonical revision changed, in current projection order.
Sourcepub fn sync_load_chatend(
&self,
journal: &mut HistorySession,
recorded_at: impl Into<String>,
updates: &BTreeMap<String, NodeDraft>,
creates: &[StagedCreate],
) -> Result<Vec<BoxId>>
pub fn sync_load_chatend( &self, journal: &mut HistorySession, recorded_at: impl Into<String>, updates: &BTreeMap<String, NodeDraft>, creates: &[StagedCreate], ) -> Result<Vec<BoxId>>
Cache-preserving LoadNodes reconciliation through general Session History slot application.
Existing slots are fed back in exact order without changing layout, visible representation, occurrence history, name, or retirement. The returned IDs are only pre-existing active boxes whose canonical content advanced, in existing-slot order.