pub struct WorldState { /* private fields */ }Expand description
Mutable mid-session context layer living below the constitution prefix.
Implementations§
Source§impl WorldState
impl WorldState
pub fn new() -> Self
Sourcepub fn upsert(&mut self, fragment: ModelContextFragment) -> FragmentRender
pub fn upsert(&mut self, fragment: ModelContextFragment) -> FragmentRender
Insert or replace a fragment. Returns retain-unchanged when the hash matches the previous value for that id.
pub fn len(&self) -> usize
Sourcepub fn with_workspace(self, body: impl Into<String>) -> Self
pub fn with_workspace(self, body: impl Into<String>) -> Self
Convenience builders for the candidate volatile concerns.
pub fn with_permissions(self, body: impl Into<String>) -> Self
pub fn with_route(self, body: impl Into<String>) -> Self
pub fn with_agent_topology(self, body: impl Into<String>) -> Self
pub fn with_skills_tools(self, body: impl Into<String>) -> Self
pub fn with_token_budget(self, body: impl Into<String>) -> Self
pub fn with_project_instructions(self, body: impl Into<String>) -> Self
Sourcepub fn validate_caps(&self) -> Result<(), String>
pub fn validate_caps(&self) -> Result<(), String>
Enforce the hard caps for this WorldState. Returns an error if the
fragment count or any fragment’s byte/token size exceeds the core
ceilings (MAX_FRAGMENT_BYTES / MAX_FRAGMENT_TOKENS).
Trait Implementations§
Source§impl Clone for WorldState
impl Clone for WorldState
Source§impl Debug for WorldState
impl Debug for WorldState
Source§impl Default for WorldState
impl Default for WorldState
impl Eq for WorldState
Source§impl PartialEq for WorldState
impl PartialEq for WorldState
impl StructuralPartialEq for WorldState
Auto Trait Implementations§
impl Freeze for WorldState
impl RefUnwindSafe for WorldState
impl Send for WorldState
impl Sync for WorldState
impl Unpin for WorldState
impl UnsafeUnpin for WorldState
impl UnwindSafe for WorldState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.