pub struct ContextManager { /* private fields */ }Implementations§
Source§impl ContextManager
impl ContextManager
pub fn new( schema: HashMap<String, ContextSource>, agent_name: String, agent_version: String, ) -> ContextManager
pub fn set(&self, key: &str, value: Value) -> Result<(), AgentError>
pub fn update(&self, path: &str, value: Value) -> Result<(), AgentError>
pub fn remove(&self, key: &str) -> Option<Value>
pub fn get(&self, key: &str) -> Option<Value>
pub fn get_path(&self, path: &str) -> Option<Value>
pub fn get_all(&self) -> HashMap<String, Value>
pub async fn refresh(&self, key: &str) -> Result<(), AgentError>
pub async fn refresh_per_turn(&self) -> Result<(), AgentError>
pub async fn refresh_per_session(&self) -> Result<(), AgentError>
pub async fn initialize(&self) -> Result<(), AgentError>
pub fn register_provider(&self, name: &str, provider: Arc<dyn ContextProvider>)
pub fn validate(&self) -> Result<(), AgentError>
pub fn snapshot(&self) -> HashMap<String, Value>
pub fn restore(&self, snapshot: HashMap<String, Value>)
pub fn schema(&self) -> &HashMap<String, ContextSource>
Auto Trait Implementations§
impl !Freeze for ContextManager
impl !RefUnwindSafe for ContextManager
impl Send for ContextManager
impl Sync for ContextManager
impl Unpin for ContextManager
impl UnsafeUnpin for ContextManager
impl !UnwindSafe for ContextManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.