pub struct AgentBuilder<S: State = Empty> { /* private fields */ }Expand description
Builds an Agent; the setters are the AgentConfig keys.
Implementations§
Source§impl<S: State> AgentBuilder<S>
impl<S: State> AgentBuilder<S>
Sourcepub fn model(self, value: impl Into<ModelSource>) -> AgentBuilder<SetModel<S>>where
S::Model: IsUnset,
pub fn model(self, value: impl Into<ModelSource>) -> AgentBuilder<SetModel<S>>where
S::Model: IsUnset,
Optional (Some / Option setters).
The model the agent calls: a model instance, a ModelRouter or a Bedrock model id.
Defaults to Bedrock, resolved when the agent first calls it. With a router, the agent’s
model is the router’s default model.
Sourcepub fn maybe_model(
self,
value: Option<impl Into<ModelSource>>,
) -> AgentBuilder<SetModel<S>>where
S::Model: IsUnset,
pub fn maybe_model(
self,
value: Option<impl Into<ModelSource>>,
) -> AgentBuilder<SetModel<S>>where
S::Model: IsUnset,
Optional (Some / Option setters).
The model the agent calls: a model instance, a ModelRouter or a Bedrock model id.
Defaults to Bedrock, resolved when the agent first calls it. With a router, the agent’s
model is the router’s default model.
Sourcepub fn aux_model(
self,
value: impl Into<ModelSource>,
) -> AgentBuilder<SetAuxModel<S>>where
S::AuxModel: IsUnset,
pub fn aux_model(
self,
value: impl Into<ModelSource>,
) -> AgentBuilder<SetAuxModel<S>>where
S::AuxModel: IsUnset,
Optional (Some / Option setters).
The model for auxiliary side calls (conversation-manager summaries, memory extraction,
classification); defaults to model. The context manager’s summarize strategy does not
use it: it resolves its own model, then model. A router is rejected: side calls run outside the loop it
attaches to.
Sourcepub fn maybe_aux_model(
self,
value: Option<impl Into<ModelSource>>,
) -> AgentBuilder<SetAuxModel<S>>where
S::AuxModel: IsUnset,
pub fn maybe_aux_model(
self,
value: Option<impl Into<ModelSource>>,
) -> AgentBuilder<SetAuxModel<S>>where
S::AuxModel: IsUnset,
Optional (Some / Option setters).
The model for auxiliary side calls (conversation-manager summaries, memory extraction,
classification); defaults to model. The context manager’s summarize strategy does not
use it: it resolves its own model, then model. A router is rejected: side calls run outside the loop it
attaches to.
Sourcepub fn messages(self, value: Vec<Message>) -> AgentBuilder<SetMessages<S>>where
S::Messages: IsUnset,
pub fn messages(self, value: Vec<Message>) -> AgentBuilder<SetMessages<S>>where
S::Messages: IsUnset,
Sourcepub fn maybe_messages(
self,
value: Option<Vec<Message>>,
) -> AgentBuilder<SetMessages<S>>where
S::Messages: IsUnset,
pub fn maybe_messages(
self,
value: Option<Vec<Message>>,
) -> AgentBuilder<SetMessages<S>>where
S::Messages: IsUnset,
Sourcepub fn system_prompt(
self,
value: impl Into<SystemPrompt>,
) -> AgentBuilder<SetSystemPrompt<S>>where
S::SystemPrompt: IsUnset,
pub fn system_prompt(
self,
value: impl Into<SystemPrompt>,
) -> AgentBuilder<SetSystemPrompt<S>>where
S::SystemPrompt: IsUnset,
Sourcepub fn maybe_system_prompt(
self,
value: Option<impl Into<SystemPrompt>>,
) -> AgentBuilder<SetSystemPrompt<S>>where
S::SystemPrompt: IsUnset,
pub fn maybe_system_prompt(
self,
value: Option<impl Into<SystemPrompt>>,
) -> AgentBuilder<SetSystemPrompt<S>>where
S::SystemPrompt: IsUnset,
Sourcepub fn app_state(self, value: JsonObject) -> AgentBuilder<SetAppState<S>>where
S::AppState: IsUnset,
pub fn app_state(self, value: JsonObject) -> AgentBuilder<SetAppState<S>>where
S::AppState: IsUnset,
Sourcepub fn maybe_app_state(
self,
value: Option<JsonObject>,
) -> AgentBuilder<SetAppState<S>>where
S::AppState: IsUnset,
pub fn maybe_app_state(
self,
value: Option<JsonObject>,
) -> AgentBuilder<SetAppState<S>>where
S::AppState: IsUnset,
Sourcepub fn model_state(self, value: JsonObject) -> AgentBuilder<SetModelState<S>>where
S::ModelState: IsUnset,
pub fn model_state(self, value: JsonObject) -> AgentBuilder<SetModelState<S>>where
S::ModelState: IsUnset,
Sourcepub fn maybe_model_state(
self,
value: Option<JsonObject>,
) -> AgentBuilder<SetModelState<S>>where
S::ModelState: IsUnset,
pub fn maybe_model_state(
self,
value: Option<JsonObject>,
) -> AgentBuilder<SetModelState<S>>where
S::ModelState: IsUnset,
Sourcepub fn printer(self, value: bool) -> AgentBuilder<SetPrinter<S>>where
S::Printer: IsUnset,
pub fn printer(self, value: bool) -> AgentBuilder<SetPrinter<S>>where
S::Printer: IsUnset,
Sourcepub fn maybe_printer(self, value: Option<bool>) -> AgentBuilder<SetPrinter<S>>where
S::Printer: IsUnset,
pub fn maybe_printer(self, value: Option<bool>) -> AgentBuilder<SetPrinter<S>>where
S::Printer: IsUnset,
Sourcepub fn retry_strategy(
self,
value: Vec<RetryStrategy>,
) -> AgentBuilder<SetRetryStrategy<S>>where
S::RetryStrategy: IsUnset,
pub fn retry_strategy(
self,
value: Vec<RetryStrategy>,
) -> AgentBuilder<SetRetryStrategy<S>>where
S::RetryStrategy: IsUnset,
Optional (Some / Option setters).
Retry strategies for failed model calls. None installs the default
DefaultModelRetryStrategy; an empty list disables
retries.
Sourcepub fn maybe_retry_strategy(
self,
value: Option<Vec<RetryStrategy>>,
) -> AgentBuilder<SetRetryStrategy<S>>where
S::RetryStrategy: IsUnset,
pub fn maybe_retry_strategy(
self,
value: Option<Vec<RetryStrategy>>,
) -> AgentBuilder<SetRetryStrategy<S>>where
S::RetryStrategy: IsUnset,
Optional (Some / Option setters).
Retry strategies for failed model calls. None installs the default
DefaultModelRetryStrategy; an empty list disables
retries.
Sourcepub fn structured_output_schema_json(
self,
value: JsonSchema,
) -> AgentBuilder<SetStructuredOutputSchema<S>>where
S::StructuredOutputSchema: IsUnset,
pub fn structured_output_schema_json(
self,
value: JsonSchema,
) -> AgentBuilder<SetStructuredOutputSchema<S>>where
S::StructuredOutputSchema: IsUnset,
Sourcepub fn maybe_structured_output_schema_json(
self,
value: Option<JsonSchema>,
) -> AgentBuilder<SetStructuredOutputSchema<S>>where
S::StructuredOutputSchema: IsUnset,
pub fn maybe_structured_output_schema_json(
self,
value: Option<JsonSchema>,
) -> AgentBuilder<SetStructuredOutputSchema<S>>where
S::StructuredOutputSchema: IsUnset,
Sourcepub fn name(self, value: impl Into<String>) -> AgentBuilder<SetName<S>>where
S::Name: IsUnset,
pub fn name(self, value: impl Into<String>) -> AgentBuilder<SetName<S>>where
S::Name: IsUnset,
Sourcepub fn maybe_name(
self,
value: Option<impl Into<String>>,
) -> AgentBuilder<SetName<S>>where
S::Name: IsUnset,
pub fn maybe_name(
self,
value: Option<impl Into<String>>,
) -> AgentBuilder<SetName<S>>where
S::Name: IsUnset,
Sourcepub fn description(
self,
value: impl Into<String>,
) -> AgentBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn description(
self,
value: impl Into<String>,
) -> AgentBuilder<SetDescription<S>>where
S::Description: IsUnset,
Sourcepub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> AgentBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> AgentBuilder<SetDescription<S>>where
S::Description: IsUnset,
Sourcepub fn id(self, value: impl Into<String>) -> AgentBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn id(self, value: impl Into<String>) -> AgentBuilder<SetId<S>>where
S::Id: IsUnset,
Sourcepub fn maybe_id(
self,
value: Option<impl Into<String>>,
) -> AgentBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn maybe_id(
self,
value: Option<impl Into<String>>,
) -> AgentBuilder<SetId<S>>where
S::Id: IsUnset,
Sourcepub fn sort_tools(self, value: bool) -> AgentBuilder<SetSortTools<S>>where
S::SortTools: IsUnset,
pub fn sort_tools(self, value: bool) -> AgentBuilder<SetSortTools<S>>where
S::SortTools: IsUnset,
Optional (Some / Option setters).
Send tool specs to the model sorted by name on every request (model calls, context
summaries, token counts), to keep prompt-cache prefixes stable when the same tools are
registered in a different order, for example from MCP servers (sortTools). Sorting
happens before middleware, which can still reorder them. Defaults to false, which keeps
registration order.
Sourcepub fn maybe_sort_tools(
self,
value: Option<bool>,
) -> AgentBuilder<SetSortTools<S>>where
S::SortTools: IsUnset,
pub fn maybe_sort_tools(
self,
value: Option<bool>,
) -> AgentBuilder<SetSortTools<S>>where
S::SortTools: IsUnset,
Optional (Some / Option setters).
Send tool specs to the model sorted by name on every request (model calls, context
summaries, token counts), to keep prompt-cache prefixes stable when the same tools are
registered in a different order, for example from MCP servers (sortTools). Sorting
happens before middleware, which can still reorder them. Defaults to false, which keeps
registration order.
Sourcepub fn tool_executor(
self,
value: impl Into<ToolExecutorStrategy>,
) -> AgentBuilder<SetToolExecutor<S>>where
S::ToolExecutor: IsUnset,
pub fn tool_executor(
self,
value: impl Into<ToolExecutorStrategy>,
) -> AgentBuilder<SetToolExecutor<S>>where
S::ToolExecutor: IsUnset,
Sourcepub fn maybe_tool_executor(
self,
value: Option<impl Into<ToolExecutorStrategy>>,
) -> AgentBuilder<SetToolExecutor<S>>where
S::ToolExecutor: IsUnset,
pub fn maybe_tool_executor(
self,
value: Option<impl Into<ToolExecutorStrategy>>,
) -> AgentBuilder<SetToolExecutor<S>>where
S::ToolExecutor: IsUnset,
Sourcepub fn conversation_manager(
self,
manager: impl ConversationManager,
) -> AgentBuilder<SetConversationManager<S>>where
S::ConversationManager: IsUnset,
pub fn conversation_manager(
self,
manager: impl ConversationManager,
) -> AgentBuilder<SetConversationManager<S>>where
S::ConversationManager: IsUnset,
Optional (Some / Option setters).
Keeps the history within the context window. Defaults to a
SlidingWindowConversationManager
of 40 messages; a stateful model uses
NullConversationManager and
rejects one. The builder’s conversation_manager(..) takes a manager by value or as an
Arc.
Sourcepub fn maybe_conversation_manager(
self,
value: Option<impl ConversationManager>,
) -> AgentBuilder<SetConversationManager<S>>where
S::ConversationManager: IsUnset,
pub fn maybe_conversation_manager(
self,
value: Option<impl ConversationManager>,
) -> AgentBuilder<SetConversationManager<S>>where
S::ConversationManager: IsUnset,
Optional (Some / Option setters).
Keeps the history within the context window. Defaults to a
SlidingWindowConversationManager
of 40 messages; a stateful model uses
NullConversationManager and
rejects one. The builder’s conversation_manager(..) takes a manager by value or as an
Arc.
Sourcepub fn context_manager(
self,
value: impl Into<ContextManagerStrategy>,
) -> AgentBuilder<SetContextManager<S>>where
S::ContextManager: IsUnset,
pub fn context_manager(
self,
value: impl Into<ContextManagerStrategy>,
) -> AgentBuilder<SetContextManager<S>>where
S::ContextManager: IsUnset,
Sourcepub fn maybe_context_manager(
self,
value: Option<impl Into<ContextManagerStrategy>>,
) -> AgentBuilder<SetContextManager<S>>where
S::ContextManager: IsUnset,
pub fn maybe_context_manager(
self,
value: Option<impl Into<ContextManagerStrategy>>,
) -> AgentBuilder<SetContextManager<S>>where
S::ContextManager: IsUnset,
Sourcepub fn background_tasks(
self,
value: impl Into<Toggle<BackgroundTasksConfig>>,
) -> AgentBuilder<SetBackgroundTasks<S>>where
S::BackgroundTasks: IsUnset,
pub fn background_tasks(
self,
value: impl Into<Toggle<BackgroundTasksConfig>>,
) -> AgentBuilder<SetBackgroundTasks<S>>where
S::BackgroundTasks: IsUnset,
Optional (Some / Option setters).
Background tool execution:
true, a BackgroundTasksConfig, or false. Unset is off.
Sourcepub fn maybe_background_tasks(
self,
value: Option<impl Into<Toggle<BackgroundTasksConfig>>>,
) -> AgentBuilder<SetBackgroundTasks<S>>where
S::BackgroundTasks: IsUnset,
pub fn maybe_background_tasks(
self,
value: Option<impl Into<Toggle<BackgroundTasksConfig>>>,
) -> AgentBuilder<SetBackgroundTasks<S>>where
S::BackgroundTasks: IsUnset,
Optional (Some / Option setters).
Background tool execution:
true, a BackgroundTasksConfig, or false. Unset is off.
Sourcepub fn trace_attributes(
self,
attributes: impl IntoIterator<Item = (impl Into<String>, impl Into<AttributeValue>)>,
) -> AgentBuilder<SetTraceAttributes<S>>where
S::TraceAttributes: IsUnset,
pub fn trace_attributes(
self,
attributes: impl IntoIterator<Item = (impl Into<String>, impl Into<AttributeValue>)>,
) -> AgentBuilder<SetTraceAttributes<S>>where
S::TraceAttributes: IsUnset,
Sourcepub fn maybe_trace_attributes(
self,
value: Option<impl IntoIterator<Item = (impl Into<String>, impl Into<AttributeValue>)>>,
) -> AgentBuilder<SetTraceAttributes<S>>where
S::TraceAttributes: IsUnset,
pub fn maybe_trace_attributes(
self,
value: Option<impl IntoIterator<Item = (impl Into<String>, impl Into<AttributeValue>)>>,
) -> AgentBuilder<SetTraceAttributes<S>>where
S::TraceAttributes: IsUnset,
Sourcepub fn baggage_attributes(
self,
entries: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> AgentBuilder<SetBaggageAttributes<S>>where
S::BaggageAttributes: IsUnset,
pub fn baggage_attributes(
self,
entries: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> AgentBuilder<SetBaggageAttributes<S>>where
S::BaggageAttributes: IsUnset,
Sourcepub fn maybe_baggage_attributes(
self,
value: Option<impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>>,
) -> AgentBuilder<SetBaggageAttributes<S>>where
S::BaggageAttributes: IsUnset,
pub fn maybe_baggage_attributes(
self,
value: Option<impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>>,
) -> AgentBuilder<SetBaggageAttributes<S>>where
S::BaggageAttributes: IsUnset,
Sourcepub fn sandbox(self, sandbox: impl IntoSandbox) -> AgentBuilder<SetSandbox<S>>where
S::Sandbox: IsUnset,
pub fn sandbox(self, sandbox: impl IntoSandbox) -> AgentBuilder<SetSandbox<S>>where
S::Sandbox: IsUnset,
Optional (Some / Option setters).
Where sandbox-aware tools run commands and code and read and write files (sandbox).
None uses the shared
NotASandboxLocalEnvironment, the host
with no isolation. A configured sandbox’s get_tools are
registered at initialization, except those whose name is already registered. The
builder’s sandbox(..) takes a sandbox by value or as an Arc.
Sourcepub fn maybe_sandbox(
self,
value: Option<impl IntoSandbox>,
) -> AgentBuilder<SetSandbox<S>>where
S::Sandbox: IsUnset,
pub fn maybe_sandbox(
self,
value: Option<impl IntoSandbox>,
) -> AgentBuilder<SetSandbox<S>>where
S::Sandbox: IsUnset,
Optional (Some / Option setters).
Where sandbox-aware tools run commands and code and read and write files (sandbox).
None uses the shared
NotASandboxLocalEnvironment, the host
with no isolation. A configured sandbox’s get_tools are
registered at initialization, except those whose name is already registered. The
builder’s sandbox(..) takes a sandbox by value or as an Arc.
Sourcepub fn storage(self, storage: impl IntoStorage) -> AgentBuilder<SetStorage<S>>where
S::Storage: IsUnset,
pub fn storage(self, storage: impl IntoStorage) -> AgentBuilder<SetStorage<S>>where
S::Storage: IsUnset,
Optional (Some / Option setters).
Default storage backend for agent subsystems (storage). Subsystems without their own
storage (the session manager, the context manager’s archive) resolve from it, each under
its own namespace; a subsystem’s own storage always wins. The builder’s storage(..)
takes a storage by value or as an Arc.
Sourcepub fn maybe_storage(
self,
value: Option<impl IntoStorage>,
) -> AgentBuilder<SetStorage<S>>where
S::Storage: IsUnset,
pub fn maybe_storage(
self,
value: Option<impl IntoStorage>,
) -> AgentBuilder<SetStorage<S>>where
S::Storage: IsUnset,
Optional (Some / Option setters).
Default storage backend for agent subsystems (storage). Subsystems without their own
storage (the session manager, the context manager’s archive) resolve from it, each under
its own namespace; a subsystem’s own storage always wins. The builder’s storage(..)
takes a storage by value or as an Arc.
Sourcepub fn session_manager(
self,
value: SessionManager,
) -> AgentBuilder<SetSessionManager<S>>where
S::SessionManager: IsUnset,
pub fn session_manager(
self,
value: SessionManager,
) -> AgentBuilder<SetSessionManager<S>>where
S::SessionManager: IsUnset,
Optional (Some / Option setters).
Saves and restores the agent’s session. With one attached, the agent’s
session id is the manager’s and the model receives it in its
AgentMetadata.
Sourcepub fn maybe_session_manager(
self,
value: Option<SessionManager>,
) -> AgentBuilder<SetSessionManager<S>>where
S::SessionManager: IsUnset,
pub fn maybe_session_manager(
self,
value: Option<SessionManager>,
) -> AgentBuilder<SetSessionManager<S>>where
S::SessionManager: IsUnset,
Optional (Some / Option setters).
Saves and restores the agent’s session. With one attached, the agent’s
session id is the manager’s and the model receives it in its
AgentMetadata.
Sourcepub fn memory_manager(
self,
value: impl Into<MemoryManagerSource>,
) -> AgentBuilder<SetMemoryManager<S>>where
S::MemoryManager: IsUnset,
pub fn memory_manager(
self,
value: impl Into<MemoryManagerSource>,
) -> AgentBuilder<SetMemoryManager<S>>where
S::MemoryManager: IsUnset,
Optional (Some / Option setters).
Cross-session memory: a MemoryManager
or a MemoryManagerConfig the agent builds one from.
Sourcepub fn maybe_memory_manager(
self,
value: Option<impl Into<MemoryManagerSource>>,
) -> AgentBuilder<SetMemoryManager<S>>where
S::MemoryManager: IsUnset,
pub fn maybe_memory_manager(
self,
value: Option<impl Into<MemoryManagerSource>>,
) -> AgentBuilder<SetMemoryManager<S>>where
S::MemoryManager: IsUnset,
Optional (Some / Option setters).
Cross-session memory: a MemoryManager
or a MemoryManagerConfig the agent builds one from.
Source§impl<S: State> AgentBuilder<S>
impl<S: State> AgentBuilder<S>
Sourcepub fn tools(
self,
tools: impl IntoIterator<Item = impl Into<ToolSource>>,
) -> Self
pub fn tools( self, tools: impl IntoIterator<Item = impl Into<ToolSource>>, ) -> Self
Adds tools: any iterator of tools, agents, Arc<dyn Tool>s or nested lists
(tools). Mixed types go through tool_list!.
Sourcepub fn plugins(self, plugins: impl IntoIterator<Item = impl Plugin>) -> Self
pub fn plugins(self, plugins: impl IntoIterator<Item = impl Plugin>) -> Self
Adds plugins, by value or as Arcs (plugins).
Sourcepub fn interventions(
self,
handlers: impl IntoIterator<Item = impl InterventionHandler>,
) -> Self
pub fn interventions( self, handlers: impl IntoIterator<Item = impl InterventionHandler>, ) -> Self
Adds intervention handlers of one type, by value or as Arcs (interventions). Add
handlers of different types with intervention, one at a time, or
as a list of Arc<dyn InterventionHandler>:
use std::sync::Arc;
use strands::Agent;
use strands::interventions::InterventionHandler;
use strands::testing::MockModel;
use strands::vended_interventions::hitl::{HumanInTheLoop, HumanInTheLoopConfig};
struct Audit;
#[strands::async_trait]
impl InterventionHandler for Audit {
fn name(&self) -> &str {
"audit"
}
}
let one_by_one = Agent::builder()
.model(MockModel::new())
.intervention(HumanInTheLoop::default())
.intervention(Audit)
.printer(false)
.build()?;
let shared: [Arc<dyn InterventionHandler>; 2] = [Arc::new(HumanInTheLoop::default()), Arc::new(Audit)];
let listed = Agent::builder().model(MockModel::new()).interventions(shared).printer(false).build()?;Sourcepub fn intervention(self, handler: impl InterventionHandler) -> Self
pub fn intervention(self, handler: impl InterventionHandler) -> Self
Adds one intervention handler, by value or as an Arc (an Arc<dyn InterventionHandler>
included), after the ones already added.
Sourcepub fn structured_output_schema<T: SchemarsJsonSchema>(
self,
) -> AgentBuilder<SetStructuredOutputSchema<S>>where
S::StructuredOutputSchema: IsUnset,
pub fn structured_output_schema<T: SchemarsJsonSchema>(
self,
) -> AgentBuilder<SetStructuredOutputSchema<S>>where
S::StructuredOutputSchema: IsUnset,
Sets the structured output schema from a type’s schemars schema;
needs schemars = "1" in your dependencies.
Source§impl<S: IsComplete> AgentBuilder<S>
impl<S: IsComplete> AgentBuilder<S>
Auto Trait Implementations§
impl<S = Empty> !RefUnwindSafe for AgentBuilder<S>
impl<S = Empty> !UnwindSafe for AgentBuilder<S>
impl<S> Freeze for AgentBuilder<S>
impl<S> Send for AgentBuilder<S>
impl<S> Sync for AgentBuilder<S>
impl<S> Unpin for AgentBuilder<S>
impl<S> UnsafeUnpin for AgentBuilder<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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