Skip to main content

ToolRegistry

Struct ToolRegistry 

Source
pub struct ToolRegistry { /* private fields */ }

Implementations§

Source§

impl ToolRegistry

Source

pub async fn suggest_fallback_tool(&self, failed_tool: &str) -> Option<String>

Suggest a fallback tool for a failed invocation using lightweight heuristics.

Source

pub async fn available_tools(&self) -> Vec<String>

Get a list of all available tools, including MCP tools.

Source

pub async fn get_tool_schema(&self, tool_name: &str) -> Option<Value>

Get the schema for a specific tool.

Source

pub async fn has_tool(&self, name: &str) -> bool

Check if a tool with the given name is registered.

§Arguments
  • name - The name of the tool to check
§Returns

bool indicating whether the tool exists (including aliases)

Source§

impl ToolRegistry

Source

pub fn new(workspace_root: PathBuf) -> impl Future<Output = Self>

Source

pub fn new_with_loaded_config( workspace_root: PathBuf, config: &VTCodeConfig, ) -> impl Future<Output = Self>

Build a registry reusing an already-loaded session config snapshot.

Interactive startup already owns the merged VTCodeConfig; passing it here avoids a second ConfigManager::load_from_workspace file read + TOML parse on the first-paint path. Falls back to defaults for any field the snapshot does not carry, matching load_workspace_tool_config behavior on parse failure.

Source

pub fn new_for_first_paint_with_loaded_config( workspace_root: PathBuf, config: &VTCodeConfig, ) -> impl Future<Output = Self>

Build a first-paint registry: reuses the loaded session config snapshot and skips workspace policy file I/O.

Policy evaluation fails open to tool metadata defaults until hydration attaches the manager via ensure_workspace_policy_manager, which runs before any tool executes.

Source

pub fn new_with_config( workspace_root: PathBuf, pty_config: PtyConfig, ) -> impl Future<Output = Self>

Source

pub fn new_for_schema(workspace_root: PathBuf) -> impl Future<Output = Self>

Build a registry for offline metadata without creating a workspace policy file.

Source

pub fn new_with_custom_policy( workspace_root: PathBuf, policy_manager: ToolPolicyManager, ) -> impl Future<Output = Self>

Source

pub fn new_with_custom_policy_and_config( workspace_root: PathBuf, pty_config: PtyConfig, policy_manager: ToolPolicyManager, ) -> impl Future<Output = Self>

Source§

impl ToolRegistry

Source

pub fn file_cache(&self) -> &'static FileCache

Access the file cache used by this registry.

Returns the global FileCache instance. In a future phase, this will return a per-registry cache instance to enable test isolation.

Source

pub async fn cache_stats(&self) -> Value

Source

pub async fn clear_cache(&self)

Source§

impl ToolRegistry

Source

pub async fn public_tool_names( &self, surface: SessionSurface, capability_level: CapabilityLevel, ) -> Vec<String>

Source

pub async fn schema_entries( &self, config: SessionToolsConfig, ) -> Vec<ToolSchemaEntry>

Source

pub async fn function_declarations( &self, config: SessionToolsConfig, ) -> Vec<FunctionDeclaration>

Source

pub async fn model_tools( &self, config: SessionToolsConfig, ) -> Vec<ToolDefinition>

Source

pub async fn schema_for_public_name( &self, name: &str, config: SessionToolsConfig, ) -> Option<ToolSchemaEntry>

Source§

impl ToolRegistry

Source

pub async fn enable_cgp_pipeline(&self, mode: CgpRuntimeMode)

Enable the CGP pipeline for all registered tools.

This replaces each eligible tool’s handler with a CGP ToolFacade determined by the runtime mode. Registrations that provide a native CGP factory use that directly; TraitObject handlers are wrapped with registration-backed metadata before entering the passthrough bridge, and RegistryFn handlers are projected through a concrete RegistryFnTool.

Source

pub async fn register_cgp_tool( &self, tool: Arc<dyn Tool>, capability: CapabilityLevel, mode: CgpRuntimeMode, ) -> Result<()>

Wrap a single tool through the CGP pipeline and register it.

This is the preferred path for new tool registrations that should participate in the CGP approval/sandbox/logging/cache/retry pipeline.

Source§

impl ToolRegistry

Source

pub fn apply_commands_config(&self, commands_config: &CommandsConfig)

Source

pub fn commands_config(&self) -> CommandsConfig

Source§

impl ToolRegistry

Source

pub async fn execute_tool_dual( &self, name: &str, args: Value, ) -> Result<SplitToolResult>

Execute tool with dual-channel output (Phase 4: Split Tool Results).

This method enables significant token savings by separating:

  • llm_content: Concise summary sent to LLM context (token-optimized)
  • ui_content: Rich output displayed to user (full details)

For tools with registered summarizers, this can achieve 90-97% token reduction on tool outputs while preserving full details for the UI.

§Example

This snippet is illustrative; registry setup and argument construction are omitted because they depend on the caller’s tool inventory.

ⓘ
let result = registry.execute_tool_dual("grep_file", args).await?;
// result.llm_content: "Found 127 matches in 15 files. Key: src/tools/grep.rs (3)"
// result.ui_content: [Full formatted output with all 127 matches]
// Savings: ~98% token reduction
Source§

impl ToolRegistry

Source

pub fn safety_gateway(&self) -> Arc<SafetyGateway> ⓘ

Source

pub fn execute_public_tool_request( &self, request: ToolExecutionRequest, ) -> impl Future<Output = ToolExecutionOutcome> + '_

Inline-delegating wrapper that returns the inner future directly to avoid an extra coroutine state machine (audit section 16).

Source

pub async fn execute_prepared_public_tool_request( &self, prepared: &PreparedToolCall, policy: ExecutionPolicySnapshot, ) -> ToolExecutionOutcome

Source

pub fn preflight_validate_call( &self, name: &str, args: &Value, ) -> Result<ToolPreflightOutcome>

Source

pub fn preflight_validate_harness_call( &self, name: &str, args: &Value, ) -> Result<ToolPreflightOutcome>

Preflight a tool call from the harness path, allowing dispatch to internal (model-hidden) tool registrations such as read_file/write_file. Direct model-originated entry should use preflight_validate_call.

Source

pub fn admit_public_tool_call( &self, name: &str, args: &Value, ) -> Result<PreparedToolCall>

Source

pub async fn execute_tool(&self, name: &str, args: Value) -> Result<Value>

Source

pub async fn execute_public_tool_ref( &self, name: &str, args: &Value, ) -> Result<Value>

Execute a model-originated tool call through the public routing assembly.

Source

pub async fn execute_tool_ref(&self, name: &str, args: &Value) -> Result<Value>

Reference-taking version of execute_tool to avoid cloning by callers that already have access to an existing Value.

Source

pub async fn execute_tool_ref_prevalidated( &self, name: &str, args: &Value, ) -> Result<Value>

Reference-taking execution entrypoint for calls that were already preflight-validated.

This avoids re-running argument/schema/path/command preflight in hot paths where validation already happened in the runloop.

Source

pub async fn execute_public_tool_ref_prevalidated( &self, name: &str, args: &Value, ) -> Result<Value>

Prevalidated model-originated execution that still routes through the public assembly.

Source

pub async fn execute_prepared_public_tool_ref_with_mode( &self, prepared: &PreparedToolCall, exec_settlement_mode: ExecSettlementMode, ) -> Result<Value>

Source§

impl ToolRegistry

Source

pub fn resolve_tool_name_with_display(&self, name: &str) -> ResolvedToolName

Resolve a requested tool name to its canonical form.

Handles alias resolution through the inventory’s registration lookup. If the name is not found, it’s used as-is (for MCP tools or error handling).

Source

pub fn check_circuit_breaker_for( &self, tool_name: &str, display_name: &str, ) -> Option<String>

Check if a tool call should be rejected by the circuit breaker.

Returns None if the call is allowed, or Some(error_message) if rejected.

Source

pub fn resolve_tool_route(&self, tool_name: &str) -> ToolRoute

Resolve whether a tool is standard, MCP, or unknown.

Returns the tool routing information needed for execution.

Source

pub async fn check_full_auto_denied( &self, tool_name: &str, display_name: &str, ) -> Option<String>

Check if a full-auto policy denies this tool.

Returns None if allowed, or Some(error_message) if denied.

Source§

impl ToolRegistry

Source

pub fn set_matrix_coordinator(&self, active: bool)

Source§

impl ToolRegistry

Source

pub async fn shell_run_approval_reason( &self, tool_name: &str, tool_args: Option<&Value>, ) -> Result<Option<String>>

Source§

impl ToolRegistry

Source

pub fn read_file(&self, args: Value) -> impl Future<Output = Result<Value>> + '_

Inline-delegating wrapper that returns the inner future directly to avoid an extra coroutine state machine (audit section 16).

Source

pub fn write_file( &self, args: Value, ) -> impl Future<Output = Result<Value>> + '_

Inline-delegating wrapper. See Self::read_file.

Source

pub fn create_file( &self, args: Value, ) -> impl Future<Output = Result<Value>> + '_

Inline-delegating wrapper. See Self::read_file.

Source

pub async fn edit_file(&self, args: Value) -> Result<Value>

Source

pub fn delete_file( &self, args: Value, ) -> impl Future<Output = Result<Value>> + '_

Inline-delegating wrapper. See Self::read_file.

Source

pub async fn grep_file(&self, args: Value) -> Result<Value>

Source

pub fn last_grep_file_result(&self) -> Option<GrepSearchResult>

Source

pub async fn list_files(&self, args: Value) -> Result<Value>

Source§

impl ToolRegistry

Source§

impl ToolRegistry

Source

pub fn begin_tracker_request(&self, adopted: bool)

Begin a genuine request, optionally restoring adoption from its persisted history or explicit continuation. Internal turns must not reset this latch.

Source

pub fn tracker_adopted_for_request(&self) -> bool

Successful current-request adoption is independent of compactable history.

Source

pub fn set_decision_evidence_validator( &self, validator: DecisionEvidenceValidator, )

Attach the canonical queue barrier used by public decision recording.

Source

pub fn set_harness_session(&self, session_id: impl Into<String>)

Update harness session identifier used for structured tool telemetry

Source

pub fn set_harness_task(&self, task_id: Option<String>)

Update current task identifier used for structured tool telemetry

Source

pub fn harness_context_snapshot(&self) -> HarnessContextSnapshot

Snapshot harness context metadata.

Source

pub fn set_shared_circuit_breaker(&self, circuit_breaker: Arc<CircuitBreaker>)

Attach the runloop’s shared per-tool circuit breaker.

Source

pub fn shared_circuit_breaker(&self) -> Option<Arc<CircuitBreaker>>

Return the shared per-tool circuit breaker when configured.

Source

pub async fn execute_harness_command_session( &self, args: Value, ) -> Result<Value>

Execute a harness-owned verification command through the same exec/sandbox runtime used by the public command_session tool while bypassing the model-facing full-auto allow-list gate.

Source

pub async fn execute_harness_command_session_terminal_run( &self, args: Value, ) -> Result<Value>

Start a harness-owned PTY command session while retaining the session metadata even when the command exits immediately. ACP terminal sessions use explicit release semantics.

Source

pub async fn read_harness_exec_session_output( &self, session_id: &str, drain: bool, ) -> Result<Option<String>>

Source

pub fn harness_exec_session_completed<'a>( &'a self, session_id: &'a str, ) -> impl Future<Output = Result<Option<i32>>> + 'a

Inline-delegating wrapper over Self::harness_exec_session_completed. Returns the inner future directly (audit section 16).

Source

pub fn terminate_harness_exec_session<'a>( &'a self, session_id: &'a str, ) -> impl Future<Output = Result<()>> + 'a

Inline-delegating wrapper over Self::terminate_harness_exec_session.

Source

pub async fn close_harness_exec_session(&self, session_id: &str) -> Result<()>

Source

pub async fn in_progress_exec_sessions( &self, cap: usize, ) -> Vec<VTCodeExecSession>

Bounded snapshot of all exec sessions still running for turn-end diagnostics and telemetry. Newest first; capped by the caller.

Source

pub async fn in_progress_foreground_exec_sessions( &self, cap: usize, ) -> Vec<VTCodeExecSession>

Source§

impl ToolRegistry

Source

pub fn get_recent_tool_records(&self, count: usize) -> Vec<ToolExecutionRecord>

Get recent tool executions (successes and failures).

Source

pub fn get_recent_tool_failures(&self, count: usize) -> Vec<ToolExecutionRecord>

Get recent tool execution failures.

Source

pub fn task_tool_telemetry_snapshot( &self, task_id: Option<&str>, task_completed_successfully: Option<bool>, ) -> ToolTaskTelemetrySnapshot

Aggregate representative task telemetry from recorded tool executions.

Source

pub fn find_recent_spooled_output( &self, tool_name: &str, args: &Value, max_age: Duration, ) -> Option<Value>

Find a recent spooled output for a tool call with identical args.

Source

pub fn find_recent_successful_output( &self, tool_name: &str, args: &Value, max_age: Duration, ) -> Option<Value>

Find a recent successful output for a tool call with identical args.

Source

pub fn find_recent_successful_by_read_target( &self, tool_name: &str, args: &Value, max_age: Duration, ) -> Option<Value>

Find the most recent successful output for a read-only tool call that targets the same file path with a compatible read shape. Returns None for non-read-only tools or when no path can be extracted.

Source

pub fn find_recent_read_file_spool_progress( &self, path: &str, max_age: Duration, ) -> Option<(usize, usize)>

Find continuation metadata from a recent chunked file-read result for the same path.

Supports both read_file and file_operation (read action) history records.

Source

pub fn clear_execution_history(&self)

Clear the execution history.

Source

pub fn execution_history_len(&self) -> usize

Get the current number of stored execution records.

Source§

impl ToolRegistry

Source

pub fn get_tool(&self, name: &str) -> Option<Arc<dyn Tool>>

Get a tool by name from the inventory (with hot cache optimization).

Source

pub fn workspace_root(&self) -> &PathBuf

Source

pub fn workspace_root_owned(&self) -> PathBuf

Get the workspace root as an owned PathBuf.

Source

pub fn file_ops_tool(&self) -> &FileOpsTool

Source

pub fn edited_file_monitor_ref(&self) -> &EditedFileMonitor

Borrow the edited-file monitor without exposing shared ownership.

Source

pub fn edited_file_monitor(&self) -> &Arc<EditedFileMonitor> ⓘ

Get the shared edited-file monitor handle for callers that need to clone it.

Source

pub fn grep_file_manager(&self) -> Arc<GrepSearchManager> ⓘ

Source§

impl ToolRegistry

Source

pub async fn initialize_async(&self) -> Result<()>

Source§

impl ToolRegistry

Source

pub async fn with_mcp_client(self, mcp_client: Arc<McpClient>) -> Self

Set the MCP client for this registry.

Source

pub async fn set_mcp_client(&self, mcp_client: Arc<McpClient>)

Attach an MCP client without consuming the registry.

Source

pub async fn clear_mcp_client(&self)

Detach the current MCP client and clear MCP tool indexes.

Also removes MCP proxy registrations from the inventory and rebuilds the tool assembly so model_tools() no longer advertises MCP tools that cannot be executed. Without this, a primary-agent switch (which clears the client pending re-attach) leaves stale mcp__* tools on the wire that fail with “MCP client not available”.

Source

pub fn mcp_client(&self) -> Option<Arc<McpClient>>

Get the MCP client if available.

Source

pub async fn list_mcp_tools(&self) -> Result<Vec<McpToolInfo>>

List all MCP tools.

Source

pub async fn has_mcp_tool(&self, tool_name: &str) -> bool

Check if an MCP tool exists.

Source

pub async fn execute_mcp_tool( &self, tool_name: &str, args: Value, ) -> Result<Value>

Execute an MCP tool.

Source

pub async fn refresh_mcp_tools(&self) -> Result<()>

Refresh MCP tools (reconnect to providers and update tool lists).

Source§

impl ToolRegistry

Source

pub fn begin_turn_preview_window(&self)

Compatibility turn boundary for existing registry callers. Previews are bounded per result, so there is no aggregate allowance to reset and this boundary never changes output visibility.

Source

pub fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ

Return the shared metrics collector for this registry instance.

Source

pub fn tool_call_count(&self) -> u64

Get total tool calls made in current session (for observability).

Source

pub fn pty_poll_count(&self) -> u64

Get total PTY poll iterations (for CPU monitoring).

Source§

impl ToolRegistry

Source

pub fn has_optimizations_enabled(&self) -> bool

Check if optimizations are enabled.

Source

pub fn memory_pool_ref(&self) -> &MemoryPool

Borrow the memory pool for optimized allocations.

Source

pub fn memory_pool(&self) -> &Arc<MemoryPool> ⓘ

Get the shared memory pool handle for callers that need to clone it.

Source

pub fn clear_hot_cache(&self)

Clear the hot tool cache (useful for testing or memory management).

Source

pub fn hot_cache_stats(&self) -> (usize, usize)

Get hot cache statistics.

Source

pub fn configure_optimizations(&mut self, config: OptimizationConfig)

Configure performance optimizations for this registry.

Source

pub fn optimization_config(&self) -> &OptimizationConfig

Get the current optimization configuration.

Source§

impl ToolRegistry

Source

pub fn begin_patch_recovery_turn(&self)

Start a user/task turn without changing permissions or loop history.

Source

pub fn has_patch_recovery_read(&self, tool_name: &str, args: &Value) -> bool

Check admission without consuming the read before other guards run.

Source

pub fn pending_patch_recovery_read_path( &self, tool_name: &str, args: &Value, ) -> Option<PathBuf>

Canonical identity used to reserve a capped read before batch execution.

Source§

impl ToolRegistry

Source

pub fn is_mutating_tool(&self, name: &str) -> bool

Check if a tool is mutating (modifies files or environment).

Returns true if the tool is mutating or unknown (conservative default).

Source

pub fn is_planning_active_allowed(&self, tool_name: &str, args: &Value) -> bool

Check if a tool is allowed to run in planning workflow without switching modes.

Returns true for non-mutating tools and plan-safe exceptions like writing to active plan storage (/tmp/vtcode-plans/ by default) or read-only unified tool actions.

Source

pub fn is_retry_safe_call(&self, tool_name: &str, args: &Value) -> bool

Check whether a tool invocation is safe to retry.

Retries are allowed for read-only operations and for unified tools when their specific action is read-only (file_operation:read, command_session:poll|list).

Source§

impl ToolRegistry

Source

pub fn enable_planning(&self)

Enable planning workflow (read-only enforcement).

When enabled, mutating tools (file_operation writes/edits, apply_patch, command_session runs, etc.) are blocked and the agent can only read/analyze the codebase.

PlanningWorkflowState is the single source of truth; this method delegates to it so that is_planning_active() and planning_workflow_state().is_active() are always in agreement.

Source

pub fn disable_planning(&self)

Disable planning workflow (allow mutating tools again).

Source

pub fn is_planning_active(&self) -> bool

Check if planning workflow is currently enabled.

Reads directly from PlanningWorkflowState — the single authoritative flag.

Source

pub fn planning_workflow_state(&self) -> PlanningWorkflowState

Get the shared Planning workflow state (used by planning workflow tools and pipeline transitions).

Source

pub async fn apply_planning_mode_policy_overrides(&self)

Apply policy overrides for plan-mode exploration.

Saves the current policy for each exploration tool and sets it to Allow so plan mode can read the codebase without requiring manual config edits. Idempotent: if overrides are already active, does nothing.

Source

pub async fn restore_post_planning_policies(&self)

Restore policies saved by apply_planning_mode_policy_overrides.

Only touches tools whose policies were actually overridden; all other user-configured policies are left untouched.

Source§

impl ToolRegistry

Source

pub async fn enable_full_auto_permission(&self, allowed_tools: &[String])

Source

pub async fn enable_full_auto_permission_for_session( &self, allowed_tools: &[String], session_tools_config: SessionToolsConfig, )

Enable full-auto mode against the tools visible in a specific session.

Source

pub async fn disable_full_auto_permission(&self)

Source

pub async fn set_enforce_safe_mode_prompts(&self, enabled: bool)

Source

pub async fn current_full_auto_allowlist(&self) -> Option<Vec<String>>

Source

pub async fn is_allowed_in_full_auto(&self, tool_name: &str) -> bool

Source

pub async fn is_denied_in_full_auto(&self, tool_name: &str) -> bool

Source

pub async fn set_policy_manager(&self, manager: ToolPolicyManager)

Source

pub async fn has_policy_manager(&self) -> bool

Whether the registry owns a workspace policy manager.

First-paint registries skip policy file I/O; hydration attaches the manager via Self::ensure_workspace_policy_manager before any tool runs.

Source

pub async fn ensure_workspace_policy_manager(&self, workspace_root: &Path)

Attach the workspace policy manager unless one is already present.

Reads (and may create) the workspace policy file, so it belongs in hydration, not on the paint path. Fail-open: without a manager, evaluation falls back to tool metadata defaults.

Source

pub async fn set_tool_policy( &self, tool_name: &str, policy: ToolPolicy, ) -> Result<()>

Source

pub async fn persist_approval_cache_key(&self, approval_key: &str) -> Result<()>

Source

pub async fn persist_approval_cache_prefix( &self, prefix_entry: &str, ) -> Result<()>

Source

pub async fn has_persisted_approval(&self, approval_key: &str) -> bool

Source

pub async fn find_persisted_shell_approval_prefix( &self, command_words: &[String], scope_signature: &str, ) -> Option<String>

Source

pub async fn get_tool_policy(&self, tool_name: &str) -> ToolPolicy

Source

pub async fn reset_tool_policies(&self) -> Result<()>

Source

pub async fn allow_all_tools(&self) -> Result<()>

Source

pub async fn deny_all_tools(&self) -> Result<()>

Source

pub async fn print_policy_status(&self)

Source

pub async fn apply_config_policies( &self, tools_config: &ToolsConfig, ) -> Result<()>

Source

pub async fn preflight_tool_permission(&self, name: &str) -> Result<bool>

Prompt for permission before starting long-running tool executions to avoid spinner conflicts

Source

pub async fn evaluate_tool_policy( &self, name: &str, ) -> Result<ToolPermissionDecision>

Source

pub async fn mark_tool_preapproved(&self, name: &str)

Mark a tool as pre-approved for a single execution after the permission flow already granted it.

Source

pub async fn persist_mcp_tool_policy( &self, name: &str, policy: ToolPolicy, ) -> Result<()>

Source§

impl ToolRegistry

Source

pub fn replace_progress_callback( &self, callback: Option<ToolProgressCallback>, ) -> Option<ToolProgressCallback>

Replace the callback for streaming tool output and progress, returning the previous callback.

Source

pub fn set_progress_callback(&self, callback: ToolProgressCallback)

Set the callback for streaming tool output and progress

Source

pub fn clear_progress_callback(&self)

Clear the progress callback

Source

pub fn progress_callback(&self) -> Option<ToolProgressCallback>

Get the current progress callback if set

Source§

impl ToolRegistry

Source

pub fn pty_manager(&self) -> &PtyManager

Source

pub fn pty_config(&self) -> &PtyConfig

Source

pub fn can_start_pty_session(&self) -> bool

Source

pub fn start_pty_session(&self) -> Result<PtySessionGuard>

Source

pub fn end_pty_session(&self)

Source

pub fn active_pty_sessions(&self) -> usize

Source

pub fn terminate_all_pty_sessions(&self)

Source

pub fn terminate_all_pty_sessions_async( &self, ) -> impl Future<Output = Result<()>> + '_

Inline-delegating wrapper over pty::PtySessionManager::terminate_all_async. Returns the inner future directly to avoid an extra coroutine state machine (per the async-state-machine bloat audit, section 16).

Source

pub fn terminate_all_exec_sessions_async( &self, ) -> impl Future<Output = Result<()>> + '_

Inline-delegating wrapper over Self::terminate_all_exec_sessions_async.

Source

pub fn terminate_all_exec_sessions_for_exit_async( &self, ) -> impl Future<Output = Result<()>> + '_

Exit-path variant: terminates every exec session with Immediate PTY semantics (group SIGKILL, no SIGTERM grace window) so user-initiated exit is not parked ~600 ms per live PTY session.

Source

pub fn terminate_active_exec_sessions_async( &self, ) -> impl Future<Output = Result<()>> + '_

Inline-delegating wrapper that terminates only foreground exec sessions after a turn interruption, preserving user-owned background sessions.

Source

pub fn terminate_active_exec_sessions_for_exit_async( &self, ) -> impl Future<Output = Result<()>> + '_

Exit-path variant of Self::terminate_active_exec_sessions_async using Immediate PTY termination.

Source

pub fn exec_session_manager(&self) -> ExecSessionManager

Source

pub fn set_active_pty_sessions(&self, counter: Arc<AtomicUsize>)

Set the active PTY sessions counter for tracking

Source

pub fn increment_active_pty_sessions(&self)

Increment active PTY sessions count

Source

pub fn decrement_active_pty_sessions(&self)

Decrement active PTY sessions count

Source

pub fn active_pty_sessions_count(&self) -> usize

Get the current active PTY sessions count

Source§

impl ToolRegistry

Source

pub fn tool_network_access(&self, name: &str) -> ToolNetworkAccess

Resolve trusted network metadata through the same alias inventory as execution.

Source

pub async fn register_tool(&self, registration: ToolRegistration) -> Result<()>

Register or replace a tool with the registry.

§Arguments
  • registration - The tool registration to add
§Returns

Result<()> indicating success. A duplicate canonical tool name replaces the previous registration in place; alias conflicts remain errors.

Source

pub async fn unregister_tool(&self, name: &str) -> Result<bool>

Unregister a tool from the registry.

Source§

impl ToolRegistry

Source

pub async fn apply_tool_runtime_config( &self, commands_config: &CommandsConfig, tools_config: &ToolsConfig, ) -> Result<()>

Source

pub async fn apply_session_runtime_config( &self, commands_config: &CommandsConfig, permissions_config: &PermissionsConfig, sandbox_config: &SandboxConfig, timeouts: &TimeoutsConfig, tools_config: &ToolsConfig, ) -> Result<()>

Source§

impl ToolRegistry

Source

pub fn apply_sandbox_config(&self, sandbox_config: &SandboxConfig)

Source

pub fn sandbox_config(&self) -> SandboxConfig

Source§

impl ToolRegistry

Source

pub async fn create_session_prompt_task( &self, name: Option<String>, prompt: String, schedule: ScheduleSpec, created_at: DateTime<Utc>, ) -> Result<ScheduledTaskSummary>

Source

pub async fn list_session_tasks(&self) -> Vec<ScheduledTaskSummary>

Source

pub async fn delete_session_task( &self, query: &str, ) -> Option<ScheduledTaskSummary>

Source

pub async fn collect_due_session_prompts( &self, now: DateTime<Utc>, ) -> Result<Vec<DueSessionPrompt>>

Source§

impl ToolRegistry

Source

pub fn set_agent_type(&self, agent_type: impl Into<String>)

Source

pub fn check_shell_policy( &self, command: &str, deny_regex_patterns: &[String], deny_glob_patterns: &[String], ) -> Result<()>

Source§

impl ToolRegistry

Source

pub fn output_spooler(&self) -> &ToolOutputSpooler

Get the output spooler for external access.

Source

pub async fn spooled_files_count(&self) -> usize

Get the count of currently spooled files (for TUI status).

Source§

impl ToolRegistry

Source§

impl ToolRegistry

Source

pub async fn timeout_category_for(&self, name: &str) -> ToolTimeoutCategory

Source

pub async fn timeout_category_for_args( &self, name: &str, args: &Value, ) -> ToolTimeoutCategory

Source§

impl ToolRegistry

Source§

impl ToolRegistry

Source

pub fn tool_catalog_state(&self) -> Arc<SessionToolCatalogState> ⓘ

Source

pub fn attach_session_model_tools( &self, tools: Arc<RwLock<Vec<ToolDefinition>>>, )

Attach the session’s live model-facing tool definitions so registry consumers (e.g. local tool search) can read and un-defer them.

The interactive runloop calls this once, right after it builds the Arc<RwLock<Vec<ToolDefinition>>> it hands to the provider. Headless paths may never call this; every consumer of session_model_tools() must treat None as “no session tool list available” and degrade gracefully rather than error.

Source

pub fn session_model_tools(&self) -> Option<Arc<RwLock<Vec<ToolDefinition>>>>

Fetch the attached session tool list, if any.

Clones the inner Arc out from behind the std RwLock so callers never hold that lock across an .await.

Source§

impl ToolRegistry

Source

pub fn set_self_ref(&self, registry: Arc<ToolRegistry>)

Trait Implementations§

Source§

impl BuiltinToolExecutor for ToolRegistry

Source§

fn execute_builtin_tool<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tool_name: &'life1 str, args: &'life2 Value, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute a built-in tool by name with JSON args.
Source§

fn list_builtin_tools(&self) -> Result<Vec<BuiltinToolInfo>>

List built-in tools exposed to code (a curated, safe subset).
Source§

impl Clone for ToolRegistry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl McpBridge for ToolRegistry

Source§

fn set_mcp_client<'life0, 'async_trait>( &'life0 self, client: Arc<McpClient>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set or replace the MCP client.
Source§

fn clear_mcp_client<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clear the current MCP client and all cached tool indexes.
Source§

fn mcp_client(&self) -> Option<Arc<McpClient>>

Get the current MCP client, if any.
Source§

fn list_mcp_tools<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<McpToolInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all tools available via MCP.
Source§

fn has_mcp_tool<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a tool name corresponds to an MCP-provided tool.
Source§

fn execute_mcp_tool<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a tool via the MCP client.
Source§

fn refresh_mcp_tools<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Refresh MCP tool registrations from all connected servers.
Source§

impl PtySessionControl for ToolRegistry

Source§

fn can_start_session(&self) -> bool

Check whether a new PTY session can be started.
Source§

fn active_session_count(&self) -> usize

Get the number of currently active PTY sessions.
Source§

fn terminate_all_sessions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Terminate all active PTY sessions.
Source§

fn exec_session_manager(&self) -> ExecSessionManager

Get the exec session manager for subprocess tracking.
Source§

impl ToolCatalog for ToolRegistry

Source§

fn register_tool<'life0, 'async_trait>( &'life0 self, registration: ToolRegistration, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register a tool. Replaces any existing registration with the same name.
Source§

fn unregister_tool<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unregister a tool by name. Returns true if the tool existed.
Source§

fn get_tool(&self, name: &str) -> Option<Arc<dyn Tool>>

Get a tool by name (with hot-cache optimization).
Source§

fn workspace_root(&self) -> PathBuf

Get the workspace root path.
Source§

fn public_tool_names<'life0, 'async_trait>( &'life0 self, surface: SessionSurface, capability_level: CapabilityLevel, ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List public tool names for a given surface and capability level.
Source§

fn schema_entries<'life0, 'async_trait>( &'life0 self, config: SessionToolsConfig, ) -> Pin<Box<dyn Future<Output = Vec<ToolSchemaEntry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get schema entries for all available tools.
Source§

fn function_declarations<'life0, 'async_trait>( &'life0 self, config: SessionToolsConfig, ) -> Pin<Box<dyn Future<Output = Vec<FunctionDeclaration>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Gemini-style function declarations for tool-calling.
Source§

fn model_tools<'life0, 'async_trait>( &'life0 self, config: SessionToolsConfig, ) -> Pin<Box<dyn Future<Output = Vec<ToolDefinition>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get OpenAI/Anthropic-style tool definitions.
Source§

fn resolve_tool_name(&self, name: &str) -> Result<String, ToolCallError>

Resolve a public tool name to its canonical registration name.
Source§

impl ToolExecutor for ToolRegistry

Source§

fn execute_tool<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a tool by name
Source§

fn execute_tool_ref<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, args: &'life2 Value, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute a tool with a reference to arguments to avoid cloning when caller already holds a reference.
Source§

fn available_tools<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List available tools
Source§

fn has_tool<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a tool exists
Source§

fn execute_shared<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, args: Arc<Value>, ) -> Pin<Box<dyn Future<Output = Result<Arc<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a tool and return a shared result (Arc) to avoid cloning results for callers that want to keep a shared reference.
Source§

fn execute_batch<'life0, 'async_trait>( &'life0 self, calls: Vec<(String, Value)>, ) -> Pin<Box<dyn Future<Output = Vec<Result<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute multiple tools in batch. Read more
Source§

impl ToolMetrics for ToolRegistry

Source§

fn record_execution(&self, _record: ToolExecutionRecord)

Record a tool execution for history and metrics.
Source§

fn call_count(&self) -> u64

Get the total number of tool calls in this session.
Source§

fn pty_poll_count(&self) -> u64

Get the total PTY poll iterations (for CPU monitoring).
Source§

fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ

Get the shared metrics collector for external observability.
Source§

impl ToolResilience for ToolRegistry

Source§

fn effective_timeout(&self, category: ToolTimeoutCategory) -> Option<Duration>

Get the effective timeout for a tool category, considering adaptive tuning.
Source§

fn record_failure(&self, category: ToolTimeoutCategory) -> bool

Record a tool execution failure and check if circuit breaking should activate. Returns true if the circuit breaker tripped.
Source§

fn reset_failure(&self, category: ToolTimeoutCategory)

Reset failure tracking for a tool category (e.g., after a success streak).
Source§

fn record_latency(&self, category: ToolTimeoutCategory, duration: Duration)

Record a tool execution latency for adaptive timeout tuning.
Source§

fn should_circuit_break( &self, category: ToolTimeoutCategory, ) -> Option<Duration>

Check if the circuit breaker is tripped for a category. Returns the recommended backoff duration if so.
Source§

fn decay_adaptive_timeout(&self, category: ToolTimeoutCategory)

Decay adaptive timeouts after a success streak (relax backpressure).
Source§

impl ToolSecurity for ToolRegistry

Source§

fn evaluate_tool_policy<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ToolPermissionDecision>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Evaluate the permission policy for a given tool.
Source§

fn get_tool_policy<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = ToolPolicy> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the current policy for a tool.
Source§

fn set_tool_policy<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, policy: ToolPolicy, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set the policy for a specific tool.
Source§

fn mark_tool_preapproved<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark a tool as pre-approved for a single execution.
Source§

fn enable_full_auto_permission<'life0, 'life1, 'async_trait>( &'life0 self, allowed_tools: &'life1 [String], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Enable full-auto mode with an allowlist of tools.
Source§

fn disable_full_auto_permission<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Disable full-auto mode.
Source§

fn is_allowed_in_full_auto<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a tool is allowed in full-auto mode.
Source§

fn is_denied_in_full_auto<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a tool is denied by the full-auto allowlist.
Source§

fn apply_config_policies<'life0, 'life1, 'async_trait>( &'life0 self, tools_config: &'life1 ToolsConfig, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply tool policies from configuration.
Source§

fn sandbox_config(&self) -> SandboxConfig

Get the current sandbox configuration.
Source§

fn apply_sandbox_config(&self, config: &SandboxConfig)

Apply a sandbox configuration.
Source§

fn persist_approval_cache_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist an approval cache key for future sessions.
Source§

fn has_persisted_approval<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if an approval has been persisted.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CacheValue for T
where T: Send + Sync + Clone + 'static,

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> PtyHandle for T
where T: Send,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToolRegistryApi for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more