pub struct ModeManager { /* private fields */ }Expand description
Manager for execution mode state
Implementations§
Source§impl ModeManager
impl ModeManager
Sourcepub fn with_config(config: ModeConfig) -> Self
pub fn with_config(config: ModeConfig) -> Self
Create a new mode manager with custom config
Sourcepub fn mode(&self) -> ExecutionMode
pub fn mode(&self) -> ExecutionMode
Get the current execution mode
Sourcepub fn config(&self) -> &ModeConfig
pub fn config(&self) -> &ModeConfig
Get the current config
Sourcepub fn set_mode(&mut self, mode: ExecutionMode)
pub fn set_mode(&mut self, mode: ExecutionMode)
Set the execution mode
Sourcepub fn can_execute_tool(
&self,
tool_name: &str,
category: ToolCategory,
) -> ToolExecutionCheck
pub fn can_execute_tool( &self, tool_name: &str, category: ToolCategory, ) -> ToolExecutionCheck
Check if a tool can be executed
Sourcepub fn confirm_tool(&mut self, tool_name: impl Into<String>)
pub fn confirm_tool(&mut self, tool_name: impl Into<String>)
Mark a tool as confirmed for this session
Sourcepub fn block_tool_for_session(&mut self, tool_name: impl Into<String>)
pub fn block_tool_for_session(&mut self, tool_name: impl Into<String>)
Block a tool for this session
Sourcepub fn clear_session_state(&mut self)
pub fn clear_session_state(&mut self)
Clear session state (confirmed and blocked tools)
Sourcepub fn pending_confirmations(&self) -> Vec<&String>
pub fn pending_confirmations(&self) -> Vec<&String>
Get list of tools that require confirmation
Trait Implementations§
Source§impl Clone for ModeManager
impl Clone for ModeManager
Source§fn clone(&self) -> ModeManager
fn clone(&self) -> ModeManager
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 ModeManager
impl Debug for ModeManager
Auto Trait Implementations§
impl Freeze for ModeManager
impl RefUnwindSafe for ModeManager
impl Send for ModeManager
impl Sync for ModeManager
impl Unpin for ModeManager
impl UnwindSafe for ModeManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].