AutoForestBuilder

Struct AutoForestBuilder 

Source
pub struct AutoForestBuilder { /* private fields */ }
Expand description

Builder for AutoForest

Implementationsยง

Sourceยง

impl AutoForestBuilder

Source

pub fn new(config: Config) -> Self

Creates a new AutoForestBuilder with the given config

Source

pub fn with_tools(self, tools: Vec<Box<dyn Tool>>) -> Self

Sets the tools available to the forest

Examples found in repository?
examples/auto_forest_demo.rs (lines 27-30)
15async fn main() -> helios_engine::Result<()> {
16    println!("๐ŸŒฒ AutoForest - Intelligent Agent Orchestration Demo\n");
17    println!("====================================================\n");
18
19    // Step 1: Load or create configuration
20    println!("๐Ÿ“‹ Creating configuration...");
21    let config = Config::builder().temperature(0.7).max_tokens(2048).build();
22    println!("โœ“ Configuration ready\n");
23
24    // Step 2: Create AutoForest with available tools
25    println!("๐Ÿ”ง Initializing AutoForest with tools...");
26    let mut auto_forest = AutoForest::new(config)
27        .with_tools(vec![
28            Box::new(CalculatorTool),
29            // Additional tools could be added here
30        ])
31        .build()
32        .await?;
33    println!("โœ“ AutoForest initialized\n");
34
35    // Step 3: Define a complex task
36    let task = r#"
37    I need to analyze a business problem:
38    1. A company has Q3 revenue data showing mixed results across 5 product categories
39    2. I need to understand which categories are underperforming
40    3. Calculate the performance metrics for each category
41    4. Identify trends and predict Q4 performance
42    5. Recommend which categories need attention
43    "#;
44
45    println!("๐Ÿ“ Submitting task to AutoForest...");
46    println!("Task: {}\n", task.trim());
47
48    // Step 4: Execute the task
49    println!("๐Ÿš€ AutoForest is orchestrating agent deployment...\n");
50    let result = auto_forest.execute_task(task).await?;
51
52    // Step 5: Display the orchestration plan
53    println!("๐Ÿ“Š Orchestration Plan Generated:");
54    println!("================================\n");
55
56    if let Some(plan) = auto_forest.orchestration_plan() {
57        println!("Task: {}", plan.task.trim());
58        println!("Number of Agents Spawned: {}", plan.num_agents);
59        println!("Planning Reasoning: {}\n", plan.reasoning);
60
61        println!("Agent Configurations:");
62        println!("-----------------");
63        for (i, agent_config) in plan.agents.iter().enumerate() {
64            println!(
65                "Agent {}: {} ({})",
66                i + 1,
67                agent_config.name,
68                agent_config.role
69            );
70            println!("  Prompt: {}", agent_config.system_prompt);
71            if !agent_config.tool_indices.is_empty() {
72                println!("  Tools: {:?}", agent_config.tool_indices);
73            }
74            println!();
75        }
76
77        println!("Task Breakdown:");
78        println!("--------------");
79        for (agent_name, subtask) in &plan.task_breakdown {
80            println!("โ€ข {} โ†’ {}", agent_name, subtask);
81        }
82        println!();
83    }
84
85    // Step 6: Display spawned agents
86    println!("๐Ÿค– Spawned Agents:");
87    println!("-----------------");
88    let spawned = auto_forest.spawned_agents();
89    println!("Total agents created: {}\n", spawned.len());
90
91    for (i, spawned_agent) in spawned.iter().enumerate() {
92        println!("Agent {}: {}", i + 1, spawned_agent.config.name);
93        println!("  Role: {}", spawned_agent.config.role);
94        if let Some(result) = &spawned_agent.result {
95            println!("  Result available: Yes ({} chars)", result.len());
96        } else {
97            println!("  Result: Pending");
98        }
99        println!();
100    }
101
102    // Step 7: Display the final synthesized result
103    println!("๐Ÿ“ˆ Final Synthesized Result:");
104    println!("==========================\n");
105    println!("{}\n", result);
106
107    // Step 8: Demonstrate a second task with different complexity
108    println!("\n๐Ÿ”„ Executing a second task with different complexity...\n");
109
110    let simple_task = "Calculate the average of these numbers: 100, 200, 300, 400, 500. Then tell me what percentage each is of the total.";
111
112    println!("Task: {}\n", simple_task);
113    println!("๐Ÿš€ Processing...\n");
114
115    let result2 = auto_forest.execute_task(simple_task).await?;
116
117    println!("Result:\n{}\n", result2);
118
119    if let Some(plan) = auto_forest.orchestration_plan() {
120        println!(
121            "This task resulted in {} agent(s) - a simpler orchestration plan.",
122            plan.num_agents
123        );
124        println!("Reasoning: {}\n", plan.reasoning);
125    }
126
127    println!("โœ… AutoForest demo completed!");
128    println!("=============================");
129    println!("\n๐Ÿ’ก Key Features Demonstrated:");
130    println!("  โ€ข Automatic agent spawning based on task complexity");
131    println!("  โ€ข Specialized agent prompt generation");
132    println!("  โ€ข Task breakdown across agents");
133    println!("  โ€ข Result aggregation and synthesis");
134    println!("  โ€ข Flexible orchestration for varying task complexity");
135
136    Ok(())
137}
More examples
Hide additional examples
examples/ultra_simple.rs (line 83)
9async fn main() -> helios_engine::Result<()> {
10    println!("๐Ÿš€ Ultra Simple Helios Example\n");
11
12    // ========== SIMPLEST AGENT CREATION ==========
13    println!("1๏ธโƒฃ  Creating an agent - shortest possible syntax:\n");
14
15    // One-liner: Create agent with auto config
16    let mut agent = Agent::builder("Helper")
17        .auto_config()
18        .prompt("You are helpful and concise.")
19        .build()
20        .await?;
21
22    println!("โœ“ Agent created!\n");
23
24    // ========== SIMPLEST CHAT ==========
25    println!("2๏ธโƒฃ  Asking questions - simplest possible:\n");
26
27    // Use .ask() instead of .chat() for more natural syntax
28    let answer = agent.ask("What is 2+2?").await?;
29    println!("Q: What is 2+2?\nA: {}\n", answer);
30
31    // ========== SIMPLEST CONFIG ==========
32    println!("3๏ธโƒฃ  Creating config with shortest syntax:\n");
33
34    // Ultra-short config creation
35    let _config = Config::builder()
36        .m("gpt-4") // .m() is shorthand for .model()
37        .key("your-api-key") // .key() is shorthand for .api_key()
38        .temp(0.8) // .temp() is shorthand for .temperature()
39        .tokens(1024) // .tokens() is shorthand for .max_tokens()
40        .build();
41
42    println!("โœ“ Config created with ultra-short syntax!\n");
43
44    // ========== SIMPLEST AGENT WITH TOOLS ==========
45    println!("4๏ธโƒฃ  Agent with tools - simplest way:\n");
46
47    let mut calc_agent = Agent::builder("Calculator")
48        .auto_config()
49        .prompt("You are a math expert.")
50        .with_tool(Box::new(CalculatorTool)) // Add single tool
51        .build()
52        .await?;
53
54    let result = calc_agent.ask("Calculate 15 * 7 + 5").await?;
55    println!("Q: Calculate 15 * 7 + 5\nA: {}\n", result);
56
57    // ========== SIMPLEST QUICK AGENT ==========
58    println!("5๏ธโƒฃ  Quick agent - one method call:\n");
59
60    // Agent::quick() creates agent in ONE LINE with auto config!
61    let mut quick_agent = Agent::quick("QuickBot").await?;
62    let quick_answer = quick_agent.ask("Say hello!").await?;
63    println!("Response: {}\n", quick_answer);
64
65    // ========== SIMPLEST CHAT MESSAGES ==========
66    println!("6๏ธโƒฃ  Creating messages - super short syntax:\n");
67
68    use helios_engine::ChatMessage;
69
70    // Short aliases for message creation
71    let _sys_msg = ChatMessage::sys("You are helpful"); // .sys() not .system()
72    let _user_msg = ChatMessage::msg("Hello there"); // .msg() not .user()
73    let _reply_msg = ChatMessage::reply("Hi! How can I help?"); // .reply() not .assistant()
74
75    println!("โœ“ Messages created with ultra-short syntax!\n");
76
77    // ========== SHORTEST AUTOFOREST ==========
78    println!("7๏ธโƒฃ  AutoForest - simplest multi-agent orchestration:\n");
79
80    use helios_engine::AutoForest;
81
82    let mut forest = AutoForest::new(Config::builder().m("gpt-4").build())
83        .with_tools(vec![Box::new(CalculatorTool)])
84        .build()
85        .await?;
86
87    // Use .run() for shortest syntax
88    let forest_result = forest.run("Analyze these numbers: 10, 20, 30, 40").await?;
89    println!("Forest Result:\n{}\n", forest_result);
90
91    // ========== COMPARISON TABLE ==========
92    println!("๐Ÿ“Š Syntax Comparison - Short vs Long:\n");
93    println!("โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”");
94    println!("โ”‚ Operation           โ”‚ Short Syntax         โ”‚ Long Syntax      โ”‚");
95    println!("โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค");
96    println!("โ”‚ Create Agent        โ”‚ Agent::quick()       โ”‚ Agent::builder()โ”‚");
97    println!("โ”‚ Ask Question        โ”‚ .ask()               โ”‚ .chat()          โ”‚");
98    println!("โ”‚ System Prompt       โ”‚ .prompt()            โ”‚ .system_prompt() โ”‚");
99    println!("โ”‚ Config Model        โ”‚ .m()                 โ”‚ .model()         โ”‚");
100    println!("โ”‚ Config Key          โ”‚ .key()               โ”‚ .api_key()       โ”‚");
101    println!("โ”‚ Config Temp         โ”‚ .temp()              โ”‚ .temperature()   โ”‚");
102    println!("โ”‚ Config Tokens       โ”‚ .tokens()            โ”‚ .max_tokens()    โ”‚");
103    println!("โ”‚ System Message      โ”‚ ChatMessage::sys()   โ”‚ ChatMessage::system()");
104    println!("โ”‚ User Message        โ”‚ ChatMessage::msg()   โ”‚ ChatMessage::user()");
105    println!("โ”‚ Assistant Message   โ”‚ ChatMessage::reply() โ”‚ ChatMessage::assistant()");
106    println!("โ”‚ AutoForest Execute  โ”‚ .run()               โ”‚ .execute_task()  โ”‚");
107    println!("โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜\n");
108
109    println!("โœ… All examples completed!");
110    println!("๐Ÿ’ก Tip: Mix and match short and long syntax based on your preference!");
111
112    Ok(())
113}
Source

pub async fn build(self) -> Result<AutoForest>

Builds the AutoForest orchestrator

Examples found in repository?
examples/auto_forest_demo.rs (line 31)
15async fn main() -> helios_engine::Result<()> {
16    println!("๐ŸŒฒ AutoForest - Intelligent Agent Orchestration Demo\n");
17    println!("====================================================\n");
18
19    // Step 1: Load or create configuration
20    println!("๐Ÿ“‹ Creating configuration...");
21    let config = Config::builder().temperature(0.7).max_tokens(2048).build();
22    println!("โœ“ Configuration ready\n");
23
24    // Step 2: Create AutoForest with available tools
25    println!("๐Ÿ”ง Initializing AutoForest with tools...");
26    let mut auto_forest = AutoForest::new(config)
27        .with_tools(vec![
28            Box::new(CalculatorTool),
29            // Additional tools could be added here
30        ])
31        .build()
32        .await?;
33    println!("โœ“ AutoForest initialized\n");
34
35    // Step 3: Define a complex task
36    let task = r#"
37    I need to analyze a business problem:
38    1. A company has Q3 revenue data showing mixed results across 5 product categories
39    2. I need to understand which categories are underperforming
40    3. Calculate the performance metrics for each category
41    4. Identify trends and predict Q4 performance
42    5. Recommend which categories need attention
43    "#;
44
45    println!("๐Ÿ“ Submitting task to AutoForest...");
46    println!("Task: {}\n", task.trim());
47
48    // Step 4: Execute the task
49    println!("๐Ÿš€ AutoForest is orchestrating agent deployment...\n");
50    let result = auto_forest.execute_task(task).await?;
51
52    // Step 5: Display the orchestration plan
53    println!("๐Ÿ“Š Orchestration Plan Generated:");
54    println!("================================\n");
55
56    if let Some(plan) = auto_forest.orchestration_plan() {
57        println!("Task: {}", plan.task.trim());
58        println!("Number of Agents Spawned: {}", plan.num_agents);
59        println!("Planning Reasoning: {}\n", plan.reasoning);
60
61        println!("Agent Configurations:");
62        println!("-----------------");
63        for (i, agent_config) in plan.agents.iter().enumerate() {
64            println!(
65                "Agent {}: {} ({})",
66                i + 1,
67                agent_config.name,
68                agent_config.role
69            );
70            println!("  Prompt: {}", agent_config.system_prompt);
71            if !agent_config.tool_indices.is_empty() {
72                println!("  Tools: {:?}", agent_config.tool_indices);
73            }
74            println!();
75        }
76
77        println!("Task Breakdown:");
78        println!("--------------");
79        for (agent_name, subtask) in &plan.task_breakdown {
80            println!("โ€ข {} โ†’ {}", agent_name, subtask);
81        }
82        println!();
83    }
84
85    // Step 6: Display spawned agents
86    println!("๐Ÿค– Spawned Agents:");
87    println!("-----------------");
88    let spawned = auto_forest.spawned_agents();
89    println!("Total agents created: {}\n", spawned.len());
90
91    for (i, spawned_agent) in spawned.iter().enumerate() {
92        println!("Agent {}: {}", i + 1, spawned_agent.config.name);
93        println!("  Role: {}", spawned_agent.config.role);
94        if let Some(result) = &spawned_agent.result {
95            println!("  Result available: Yes ({} chars)", result.len());
96        } else {
97            println!("  Result: Pending");
98        }
99        println!();
100    }
101
102    // Step 7: Display the final synthesized result
103    println!("๐Ÿ“ˆ Final Synthesized Result:");
104    println!("==========================\n");
105    println!("{}\n", result);
106
107    // Step 8: Demonstrate a second task with different complexity
108    println!("\n๐Ÿ”„ Executing a second task with different complexity...\n");
109
110    let simple_task = "Calculate the average of these numbers: 100, 200, 300, 400, 500. Then tell me what percentage each is of the total.";
111
112    println!("Task: {}\n", simple_task);
113    println!("๐Ÿš€ Processing...\n");
114
115    let result2 = auto_forest.execute_task(simple_task).await?;
116
117    println!("Result:\n{}\n", result2);
118
119    if let Some(plan) = auto_forest.orchestration_plan() {
120        println!(
121            "This task resulted in {} agent(s) - a simpler orchestration plan.",
122            plan.num_agents
123        );
124        println!("Reasoning: {}\n", plan.reasoning);
125    }
126
127    println!("โœ… AutoForest demo completed!");
128    println!("=============================");
129    println!("\n๐Ÿ’ก Key Features Demonstrated:");
130    println!("  โ€ข Automatic agent spawning based on task complexity");
131    println!("  โ€ข Specialized agent prompt generation");
132    println!("  โ€ข Task breakdown across agents");
133    println!("  โ€ข Result aggregation and synthesis");
134    println!("  โ€ข Flexible orchestration for varying task complexity");
135
136    Ok(())
137}
More examples
Hide additional examples
examples/ultra_simple.rs (line 84)
9async fn main() -> helios_engine::Result<()> {
10    println!("๐Ÿš€ Ultra Simple Helios Example\n");
11
12    // ========== SIMPLEST AGENT CREATION ==========
13    println!("1๏ธโƒฃ  Creating an agent - shortest possible syntax:\n");
14
15    // One-liner: Create agent with auto config
16    let mut agent = Agent::builder("Helper")
17        .auto_config()
18        .prompt("You are helpful and concise.")
19        .build()
20        .await?;
21
22    println!("โœ“ Agent created!\n");
23
24    // ========== SIMPLEST CHAT ==========
25    println!("2๏ธโƒฃ  Asking questions - simplest possible:\n");
26
27    // Use .ask() instead of .chat() for more natural syntax
28    let answer = agent.ask("What is 2+2?").await?;
29    println!("Q: What is 2+2?\nA: {}\n", answer);
30
31    // ========== SIMPLEST CONFIG ==========
32    println!("3๏ธโƒฃ  Creating config with shortest syntax:\n");
33
34    // Ultra-short config creation
35    let _config = Config::builder()
36        .m("gpt-4") // .m() is shorthand for .model()
37        .key("your-api-key") // .key() is shorthand for .api_key()
38        .temp(0.8) // .temp() is shorthand for .temperature()
39        .tokens(1024) // .tokens() is shorthand for .max_tokens()
40        .build();
41
42    println!("โœ“ Config created with ultra-short syntax!\n");
43
44    // ========== SIMPLEST AGENT WITH TOOLS ==========
45    println!("4๏ธโƒฃ  Agent with tools - simplest way:\n");
46
47    let mut calc_agent = Agent::builder("Calculator")
48        .auto_config()
49        .prompt("You are a math expert.")
50        .with_tool(Box::new(CalculatorTool)) // Add single tool
51        .build()
52        .await?;
53
54    let result = calc_agent.ask("Calculate 15 * 7 + 5").await?;
55    println!("Q: Calculate 15 * 7 + 5\nA: {}\n", result);
56
57    // ========== SIMPLEST QUICK AGENT ==========
58    println!("5๏ธโƒฃ  Quick agent - one method call:\n");
59
60    // Agent::quick() creates agent in ONE LINE with auto config!
61    let mut quick_agent = Agent::quick("QuickBot").await?;
62    let quick_answer = quick_agent.ask("Say hello!").await?;
63    println!("Response: {}\n", quick_answer);
64
65    // ========== SIMPLEST CHAT MESSAGES ==========
66    println!("6๏ธโƒฃ  Creating messages - super short syntax:\n");
67
68    use helios_engine::ChatMessage;
69
70    // Short aliases for message creation
71    let _sys_msg = ChatMessage::sys("You are helpful"); // .sys() not .system()
72    let _user_msg = ChatMessage::msg("Hello there"); // .msg() not .user()
73    let _reply_msg = ChatMessage::reply("Hi! How can I help?"); // .reply() not .assistant()
74
75    println!("โœ“ Messages created with ultra-short syntax!\n");
76
77    // ========== SHORTEST AUTOFOREST ==========
78    println!("7๏ธโƒฃ  AutoForest - simplest multi-agent orchestration:\n");
79
80    use helios_engine::AutoForest;
81
82    let mut forest = AutoForest::new(Config::builder().m("gpt-4").build())
83        .with_tools(vec![Box::new(CalculatorTool)])
84        .build()
85        .await?;
86
87    // Use .run() for shortest syntax
88    let forest_result = forest.run("Analyze these numbers: 10, 20, 30, 40").await?;
89    println!("Forest Result:\n{}\n", forest_result);
90
91    // ========== COMPARISON TABLE ==========
92    println!("๐Ÿ“Š Syntax Comparison - Short vs Long:\n");
93    println!("โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”");
94    println!("โ”‚ Operation           โ”‚ Short Syntax         โ”‚ Long Syntax      โ”‚");
95    println!("โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค");
96    println!("โ”‚ Create Agent        โ”‚ Agent::quick()       โ”‚ Agent::builder()โ”‚");
97    println!("โ”‚ Ask Question        โ”‚ .ask()               โ”‚ .chat()          โ”‚");
98    println!("โ”‚ System Prompt       โ”‚ .prompt()            โ”‚ .system_prompt() โ”‚");
99    println!("โ”‚ Config Model        โ”‚ .m()                 โ”‚ .model()         โ”‚");
100    println!("โ”‚ Config Key          โ”‚ .key()               โ”‚ .api_key()       โ”‚");
101    println!("โ”‚ Config Temp         โ”‚ .temp()              โ”‚ .temperature()   โ”‚");
102    println!("โ”‚ Config Tokens       โ”‚ .tokens()            โ”‚ .max_tokens()    โ”‚");
103    println!("โ”‚ System Message      โ”‚ ChatMessage::sys()   โ”‚ ChatMessage::system()");
104    println!("โ”‚ User Message        โ”‚ ChatMessage::msg()   โ”‚ ChatMessage::user()");
105    println!("โ”‚ Assistant Message   โ”‚ ChatMessage::reply() โ”‚ ChatMessage::assistant()");
106    println!("โ”‚ AutoForest Execute  โ”‚ .run()               โ”‚ .execute_task()  โ”‚");
107    println!("โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜\n");
108
109    println!("โœ… All examples completed!");
110    println!("๐Ÿ’ก Tip: Mix and match short and long syntax based on your preference!");
111
112    Ok(())
113}

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> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

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> PolicyExt for T
where T: ?Sized,

Sourceยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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, 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<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