pub struct KernelContext {
pub state: HashMap<String, Value>,
pub facts: Vec<ContextFact>,
pub tenant_id: Option<String>,
}Expand description
The context provided to the kernel (from converge-core’s Context).
This is a read-only view of the platform’s context, projected for kernel consumption. Kernels cannot mutate this directly.
Fields§
§state: HashMap<String, Value>Structured state data (from Seeds, Signals, etc.)
facts: Vec<ContextFact>Relevant facts from context (read-only view)
tenant_id: Option<String>Tenant/session identifier for recall scoping
Implementations§
Source§impl KernelContext
impl KernelContext
Sourcepub fn with_state(self, key: impl Into<String>, value: Value) -> Self
pub fn with_state(self, key: impl Into<String>, value: Value) -> Self
Add state data.
Sourcepub fn with_fact(
self,
key: impl Into<String>,
id: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn with_fact( self, key: impl Into<String>, id: impl Into<String>, content: impl Into<String>, ) -> Self
Add a fact from the platform context.
Sourcepub fn with_tenant(self, tenant_id: impl Into<String>) -> Self
pub fn with_tenant(self, tenant_id: impl Into<String>) -> Self
Set tenant identifier for recall scoping.
Trait Implementations§
Source§impl Clone for KernelContext
impl Clone for KernelContext
Source§fn clone(&self) -> KernelContext
fn clone(&self) -> KernelContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelContext
impl Debug for KernelContext
Source§impl Default for KernelContext
impl Default for KernelContext
Source§impl<'de> Deserialize<'de> for KernelContext
impl<'de> Deserialize<'de> for KernelContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KernelContext
impl RefUnwindSafe for KernelContext
impl Send for KernelContext
impl Sync for KernelContext
impl Unpin for KernelContext
impl UnwindSafe for KernelContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more