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_config( workspace_root: PathBuf, pty_config: PtyConfig, ) -> impl Future<Output = Self>

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 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
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 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 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 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_unified_exec(&self, args: Value) -> Result<Value>

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

Source

pub async fn execute_harness_unified_exec_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§

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 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_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 unified_file (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 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 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 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_plan_mode_allowed(&self, tool_name: &str, args: &Value) -> bool

Check if a tool is allowed to run in plan mode 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 (unified_file:read, unified_exec:poll|list).

Source§

impl ToolRegistry

Source

pub fn enable_plan_mode(&self)

Enable plan mode (read-only enforcement).

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

PlanModeState is the single source of truth; this method delegates to it so that is_plan_mode() and plan_mode_state().is_active() are always in agreement.

Source

pub fn disable_plan_mode(&self)

Disable plan mode (allow mutating tools again).

Source

pub fn is_plan_mode(&self) -> bool

Check if plan mode is currently enabled.

Reads directly from PlanModeState — the single authoritative flag.

Source

pub fn plan_mode_state(&self) -> PlanModeState

Get the shared Plan Mode state (used by plan mode tools and pipeline transitions).

Source§

impl ToolRegistry

Source

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

Source

pub async fn disable_full_auto_mode(&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 set_policy_manager(&self, manager: ToolPolicyManager)

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 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 async fn register_tool(&self, registration: ToolRegistration) -> Result<()>

Register a new tool with the registry.

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

Result<()> indicating success or an error if the tool is already registered

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§

impl ToolRegistry

Source§

impl ToolRegistry

Trait Implementations§

Source§

impl Clone for ToolRegistry

Source§

fn clone(&self) -> ToolRegistry

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 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

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<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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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