pub struct Client { /* private fields */ }
Expand description
Client for Agents for Amazon Bedrock Runtime
Client for invoking operations on Agents for Amazon Bedrock Runtime. Each operation on Agents for Amazon Bedrock Runtime is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_bedrockagentruntime::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_bedrockagentruntime::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateInvocation
operation has
a Client::create_invocation
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_invocation()
.invocation_id("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn create_invocation(&self) -> CreateInvocationFluentBuilder
pub fn create_invocation(&self) -> CreateInvocationFluentBuilder
Constructs a fluent builder for the CreateInvocation
operation.
- The fluent builder is configurable:
invocation_id(impl Into<String>)
/set_invocation_id(Option<String>)
:
required: falseA unique identifier for the invocation in UUID format.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description for the interactions in the invocation. For example, “User asking about weather in Seattle”.
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the associated session for the invocation. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
CreateInvocationOutput
with field(s):session_id(String)
:The unique identifier for the session associated with the invocation.
invocation_id(String)
:The unique identifier for the invocation.
created_at(DateTime)
:The timestamp for when the invocation was created.
- On failure, responds with
SdkError<CreateInvocationError>
Source§impl Client
impl Client
Sourcepub fn create_session(&self) -> CreateSessionFluentBuilder
pub fn create_session(&self) -> CreateSessionFluentBuilder
Constructs a fluent builder for the CreateSession
operation.
- The fluent builder is configurable:
session_metadata(impl Into<String>, impl Into<String>)
/set_session_metadata(Option<HashMap::<String, String>>)
:
required: falseA map of key-value pairs containing attributes to be persisted across the session. For example, the user’s ID, their language preference, and the type of device they are using.
encryption_key_arn(impl Into<String>)
/set_encryption_key_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the KMS key to use to encrypt the session data. The user or role creating the session must have permission to use the key. For more information, see Amazon Bedrock session encryption.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseSpecify the key-value pairs for the tags that you want to attach to the session.
- On success, responds with
CreateSessionOutput
with field(s):session_id(String)
:The unique identifier for the session.
session_arn(String)
:The Amazon Resource Name (ARN) of the created session.
session_status(SessionStatus)
:The current status of the session.
created_at(DateTime)
:The timestamp for when the session was created.
- On failure, responds with
SdkError<CreateSessionError>
Source§impl Client
impl Client
Sourcepub fn delete_agent_memory(&self) -> DeleteAgentMemoryFluentBuilder
pub fn delete_agent_memory(&self) -> DeleteAgentMemoryFluentBuilder
Constructs a fluent builder for the DeleteAgentMemory
operation.
- The fluent builder is configurable:
agent_id(impl Into<String>)
/set_agent_id(Option<String>)
:
required: trueThe unique identifier of the agent to which the alias belongs.
agent_alias_id(impl Into<String>)
/set_agent_alias_id(Option<String>)
:
required: trueThe unique identifier of an alias of an agent.
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: falseThe unique identifier of the memory.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: falseThe unique session identifier of the memory.
- On success, responds with
DeleteAgentMemoryOutput
- On failure, responds with
SdkError<DeleteAgentMemoryError>
Source§impl Client
impl Client
Sourcepub fn delete_session(&self) -> DeleteSessionFluentBuilder
pub fn delete_session(&self) -> DeleteSessionFluentBuilder
Constructs a fluent builder for the DeleteSession
operation.
- The fluent builder is configurable:
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the session to be deleted. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
DeleteSessionOutput
- On failure, responds with
SdkError<DeleteSessionError>
Source§impl Client
impl Client
Sourcepub fn end_session(&self) -> EndSessionFluentBuilder
pub fn end_session(&self) -> EndSessionFluentBuilder
Constructs a fluent builder for the EndSession
operation.
- The fluent builder is configurable:
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the session to end. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
EndSessionOutput
with field(s):session_id(String)
:The unique identifier of the session you ended.
session_arn(String)
:The Amazon Resource Name (ARN) of the session you ended.
session_status(SessionStatus)
:The current status of the session you ended.
- On failure, responds with
SdkError<EndSessionError>
Source§impl Client
impl Client
Sourcepub fn generate_query(&self) -> GenerateQueryFluentBuilder
pub fn generate_query(&self) -> GenerateQueryFluentBuilder
Constructs a fluent builder for the GenerateQuery
operation.
- The fluent builder is configurable:
query_generation_input(QueryGenerationInput)
/set_query_generation_input(Option<QueryGenerationInput>)
:
required: trueSpecifies information about a natural language query to transform into SQL.
transformation_configuration(TransformationConfiguration)
/set_transformation_configuration(Option<TransformationConfiguration>)
:
required: trueSpecifies configurations for transforming the natural language query into SQL.
- On success, responds with
GenerateQueryOutput
with field(s):queries(Option<Vec::<GeneratedQuery>>)
:A list of objects, each of which defines a generated query that can correspond to the natural language queries.
- On failure, responds with
SdkError<GenerateQueryError>
Source§impl Client
impl Client
Sourcepub fn get_agent_memory(&self) -> GetAgentMemoryFluentBuilder
pub fn get_agent_memory(&self) -> GetAgentMemoryFluentBuilder
Constructs a fluent builder for the GetAgentMemory
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the total number of results is greater than the maxItems value provided in the request, enter the token returned in the
nextToken
field in the response in this field to return the next batch of results.max_items(i32)
/set_max_items(Option<i32>)
:
required: falseThe maximum number of items to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.agent_id(impl Into<String>)
/set_agent_id(Option<String>)
:
required: trueThe unique identifier of the agent to which the alias belongs.
agent_alias_id(impl Into<String>)
/set_agent_alias_id(Option<String>)
:
required: trueThe unique identifier of an alias of an agent.
memory_type(MemoryType)
/set_memory_type(Option<MemoryType>)
:
required: trueThe type of memory.
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe unique identifier of the memory.
- On success, responds with
GetAgentMemoryOutput
with field(s):next_token(Option<String>)
:If the total number of results is greater than the maxItems value provided in the request, use this token when making another request in the
nextToken
field to return the next batch of results.memory_contents(Option<Vec::<Memory>>)
:Contains details of the sessions stored in the memory
- On failure, responds with
SdkError<GetAgentMemoryError>
Source§impl Client
impl Client
Sourcepub fn get_execution_flow_snapshot(
&self,
) -> GetExecutionFlowSnapshotFluentBuilder
pub fn get_execution_flow_snapshot( &self, ) -> GetExecutionFlowSnapshotFluentBuilder
Constructs a fluent builder for the GetExecutionFlowSnapshot
operation.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: trueThe unique identifier of the flow alias used for the flow execution.
execution_identifier(impl Into<String>)
/set_execution_identifier(Option<String>)
:
required: trueThe unique identifier of the flow execution.
- On success, responds with
GetExecutionFlowSnapshotOutput
with field(s):flow_identifier(String)
:The unique identifier of the flow.
flow_alias_identifier(String)
:The unique identifier of the flow alias used for the flow execution.
flow_version(String)
:The version of the flow used for the flow execution.
execution_role_arn(String)
:The Amazon Resource Name (ARN) of the IAM service role that’s used by the flow execution.
definition(String)
:The flow definition used for the flow execution, including the nodes, connections, and configuration at the time when the execution started.
The definition returns as a string that follows the structure of a FlowDefinition object.
customer_encryption_key_arn(Option<String>)
:The Amazon Resource Name (ARN) of the customer managed KMS key that’s used to encrypt the flow snapshot.
- On failure, responds with
SdkError<GetExecutionFlowSnapshotError>
Source§impl Client
impl Client
Sourcepub fn get_flow_execution(&self) -> GetFlowExecutionFluentBuilder
pub fn get_flow_execution(&self) -> GetFlowExecutionFluentBuilder
Constructs a fluent builder for the GetFlowExecution
operation.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: trueThe unique identifier of the flow alias used for the execution.
execution_identifier(impl Into<String>)
/set_execution_identifier(Option<String>)
:
required: trueThe unique identifier of the flow execution to retrieve.
- On success, responds with
GetFlowExecutionOutput
with field(s):execution_arn(String)
:The Amazon Resource Name (ARN) that uniquely identifies the flow execution.
status(FlowExecutionStatus)
:The current status of the flow execution.
Flow executions time out after 24 hours.
started_at(DateTime)
:The timestamp when the flow execution started.
ended_at(Option<DateTime>)
:The timestamp when the flow execution ended. This field is only populated when the execution has completed, failed, timed out, or been aborted.
errors(Option<Vec::<FlowExecutionError>>)
:A list of errors that occurred during the flow execution. Each error includes an error code, message, and the node where the error occurred, if applicable.
flow_alias_identifier(String)
:The unique identifier of the flow alias used for the execution.
flow_identifier(String)
:The unique identifier of the flow.
flow_version(String)
:The version of the flow used for the execution.
- On failure, responds with
SdkError<GetFlowExecutionError>
Source§impl Client
impl Client
Sourcepub fn get_invocation_step(&self) -> GetInvocationStepFluentBuilder
pub fn get_invocation_step(&self) -> GetInvocationStepFluentBuilder
Constructs a fluent builder for the GetInvocationStep
operation.
- The fluent builder is configurable:
invocation_identifier(impl Into<String>)
/set_invocation_identifier(Option<String>)
:
required: trueThe unique identifier for the invocation in UUID format.
invocation_step_id(impl Into<String>)
/set_invocation_step_id(Option<String>)
:
required: trueThe unique identifier (in UUID format) for the specific invocation step to retrieve.
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the invocation step’s associated session. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
GetInvocationStepOutput
with field(s):invocation_step(Option<InvocationStep>)
:The complete details of the requested invocation step.
- On failure, responds with
SdkError<GetInvocationStepError>
Source§impl Client
impl Client
Sourcepub fn get_session(&self) -> GetSessionFluentBuilder
pub fn get_session(&self) -> GetSessionFluentBuilder
Constructs a fluent builder for the GetSession
operation.
- The fluent builder is configurable:
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueA unique identifier for the session to retrieve. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
GetSessionOutput
with field(s):session_id(String)
:The unique identifier for the session in UUID format.
session_arn(String)
:The Amazon Resource Name (ARN) of the session.
session_status(SessionStatus)
:The current status of the session.
created_at(DateTime)
:The timestamp for when the session was created.
last_updated_at(DateTime)
:The timestamp for when the session was last modified.
session_metadata(Option<HashMap::<String, String>>)
:A map of key-value pairs containing attributes persisted across the session.
encryption_key_arn(Option<String>)
:The Amazon Resource Name (ARN) of the Key Management Service key used to encrypt the session data. For more information, see Amazon Bedrock session encryption.
- On failure, responds with
SdkError<GetSessionError>
Source§impl Client
impl Client
Sourcepub fn invoke_agent(&self) -> InvokeAgentFluentBuilder
pub fn invoke_agent(&self) -> InvokeAgentFluentBuilder
Constructs a fluent builder for the InvokeAgent
operation.
- The fluent builder is configurable:
session_state(SessionState)
/set_session_state(Option<SessionState>)
:
required: falseContains parameters that specify various attributes of the session. For more information, see Control session context.
If you include
returnControlInvocationResults
in thesessionState
field, theinputText
field will be ignored.agent_id(impl Into<String>)
/set_agent_id(Option<String>)
:
required: trueThe unique identifier of the agent to use.
agent_alias_id(impl Into<String>)
/set_agent_alias_id(Option<String>)
:
required: trueThe alias of the agent to use.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe unique identifier of the session. Use the same value across requests to continue the same conversation.
end_session(bool)
/set_end_session(Option<bool>)
:
required: falseSpecifies whether to end the session with the agent or not.
enable_trace(bool)
/set_enable_trace(Option<bool>)
:
required: falseSpecifies whether to turn on the trace or not to track the agent’s reasoning process. For more information, see Trace enablement.
input_text(impl Into<String>)
/set_input_text(Option<String>)
:
required: falseThe prompt text to send the agent.
If you include
returnControlInvocationResults
in thesessionState
field, theinputText
field will be ignored.memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: falseThe unique identifier of the agent memory.
bedrock_model_configurations(BedrockModelConfigurations)
/set_bedrock_model_configurations(Option<BedrockModelConfigurations>)
:
required: falseModel performance settings for the request.
streaming_configurations(StreamingConfigurations)
/set_streaming_configurations(Option<StreamingConfigurations>)
:
required: falseSpecifies the configurations for streaming.
To use agent streaming, you need permissions to perform the
bedrock:InvokeModelWithResponseStream
action.prompt_creation_configurations(PromptCreationConfigurations)
/set_prompt_creation_configurations(Option<PromptCreationConfigurations>)
:
required: falseSpecifies parameters that control how the service populates the agent prompt for an
InvokeAgent
request. You can control which aspects of previous invocations in the same agent session the service uses to populate the agent prompt. This gives you more granular control over the contextual history that is used to process the current request.source_arn(impl Into<String>)
/set_source_arn(Option<String>)
:
required: falseThe ARN of the resource making the request.
- On success, responds with
InvokeAgentOutput
with field(s):completion(EventReceiver<ResponseStream, ResponseStreamError>)
:The agent’s response to the user prompt.
content_type(String)
:The MIME type of the input data in the request. The default value is
application/json
.session_id(String)
:The unique identifier of the session with the agent.
memory_id(Option<String>)
:The unique identifier of the agent memory.
- On failure, responds with
SdkError<InvokeAgentError>
Source§impl Client
impl Client
Sourcepub fn invoke_flow(&self) -> InvokeFlowFluentBuilder
pub fn invoke_flow(&self) -> InvokeFlowFluentBuilder
Constructs a fluent builder for the InvokeFlow
operation.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: trueThe unique identifier of the flow alias.
inputs(FlowInput)
/set_inputs(Option<Vec::<FlowInput>>)
:
required: trueA list of objects, each containing information about an input into the flow.
enable_trace(bool)
/set_enable_trace(Option<bool>)
:
required: falseSpecifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see Track each step in your prompt flow by viewing its trace in Amazon Bedrock.
model_performance_configuration(ModelPerformanceConfiguration)
/set_model_performance_configuration(Option<ModelPerformanceConfiguration>)
:
required: falseModel performance settings for the request.
execution_id(impl Into<String>)
/set_execution_id(Option<String>)
:
required: falseThe unique identifier for the current flow execution. If you don’t provide a value, Amazon Bedrock creates the identifier for you.
- On success, responds with
InvokeFlowOutput
with field(s):response_stream(EventReceiver<FlowResponseStream, FlowResponseStreamError>)
:The output of the flow, returned as a stream. If there’s an error, the error is returned.
execution_id(Option<String>)
:The unique identifier for the current flow execution.
- On failure, responds with
SdkError<InvokeFlowError>
Source§impl Client
impl Client
Sourcepub fn invoke_inline_agent(&self) -> InvokeInlineAgentFluentBuilder
pub fn invoke_inline_agent(&self) -> InvokeInlineAgentFluentBuilder
Constructs a fluent builder for the InvokeInlineAgent
operation.
- The fluent builder is configurable:
customer_encryption_key_arn(impl Into<String>)
/set_customer_encryption_key_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use to encrypt your inline agent.
foundation_model(impl Into<String>)
/set_foundation_model(Option<String>)
:
required: trueThe model identifier (ID) of the model to use for orchestration by the inline agent. For example,
meta.llama3-1-70b-instruct-v1:0
.instruction(impl Into<String>)
/set_instruction(Option<String>)
:
required: trueThe instructions that tell the inline agent what it should do and how it should interact with users.
idle_session_ttl_in_seconds(i32)
/set_idle_session_ttl_in_seconds(Option<i32>)
:
required: falseThe number of seconds for which the inline agent should maintain session information. After this time expires, the subsequent
InvokeInlineAgent
request begins a new session.A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and the data provided before the timeout is deleted.
action_groups(AgentActionGroup)
/set_action_groups(Option<Vec::<AgentActionGroup>>)
:
required: falseA list of action groups with each action group defining the action the inline agent needs to carry out.
knowledge_bases(KnowledgeBase)
/set_knowledge_bases(Option<Vec::<KnowledgeBase>>)
:
required: falseContains information of the knowledge bases to associate with.
guardrail_configuration(GuardrailConfigurationWithArn)
/set_guardrail_configuration(Option<GuardrailConfigurationWithArn>)
:
required: falseThe guardrails to assign to the inline agent.
prompt_override_configuration(PromptOverrideConfiguration)
/set_prompt_override_configuration(Option<PromptOverrideConfiguration>)
:
required: falseConfigurations for advanced prompts used to override the default prompts to enhance the accuracy of the inline agent.
agent_collaboration(AgentCollaboration)
/set_agent_collaboration(Option<AgentCollaboration>)
:
required: falseDefines how the inline collaborator agent handles information across multiple collaborator agents to coordinate a final response. The inline collaborator agent can also be the supervisor.
collaborator_configurations(CollaboratorConfiguration)
/set_collaborator_configurations(Option<Vec::<CollaboratorConfiguration>>)
:
required: falseSettings for an inline agent collaborator called with InvokeInlineAgent.
agent_name(impl Into<String>)
/set_agent_name(Option<String>)
:
required: falseThe name for the agent.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe unique identifier of the session. Use the same value across requests to continue the same conversation.
end_session(bool)
/set_end_session(Option<bool>)
:
required: falseSpecifies whether to end the session with the inline agent or not.
enable_trace(bool)
/set_enable_trace(Option<bool>)
:
required: falseSpecifies whether to turn on the trace or not to track the agent’s reasoning process. For more information, see Using trace.
input_text(impl Into<String>)
/set_input_text(Option<String>)
:
required: falseThe prompt text to send to the agent.
If you include
returnControlInvocationResults
in thesessionState
field, theinputText
field will be ignored.streaming_configurations(StreamingConfigurations)
/set_streaming_configurations(Option<StreamingConfigurations>)
:
required: falseSpecifies the configurations for streaming.
To use agent streaming, you need permissions to perform the
bedrock:InvokeModelWithResponseStream
action.prompt_creation_configurations(PromptCreationConfigurations)
/set_prompt_creation_configurations(Option<PromptCreationConfigurations>)
:
required: falseSpecifies parameters that control how the service populates the agent prompt for an
InvokeInlineAgent
request. You can control which aspects of previous invocations in the same agent session the service uses to populate the agent prompt. This gives you more granular control over the contextual history that is used to process the current request.inline_session_state(InlineSessionState)
/set_inline_session_state(Option<InlineSessionState>)
:
required: falseParameters that specify the various attributes of a sessions. You can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group. For more information, see Control session context.
If you include
returnControlInvocationResults
in thesessionState
field, theinputText
field will be ignored.collaborators(Collaborator)
/set_collaborators(Option<Vec::<Collaborator>>)
:
required: falseList of collaborator inline agents.
bedrock_model_configurations(InlineBedrockModelConfigurations)
/set_bedrock_model_configurations(Option<InlineBedrockModelConfigurations>)
:
required: falseModel settings for the request.
orchestration_type(OrchestrationType)
/set_orchestration_type(Option<OrchestrationType>)
:
required: falseSpecifies the type of orchestration strategy for the agent. This is set to DEFAULT orchestration type, by default.
custom_orchestration(CustomOrchestration)
/set_custom_orchestration(Option<CustomOrchestration>)
:
required: falseContains details of the custom orchestration configured for the agent.
- On success, responds with
InvokeInlineAgentOutput
with field(s):completion(EventReceiver<InlineAgentResponseStream, InlineAgentResponseStreamError>)
:The inline agent’s response to the user prompt.
content_type(String)
:The MIME type of the input data in the request. The default value is application/json.
session_id(String)
:The unique identifier of the session with the agent.
- On failure, responds with
SdkError<InvokeInlineAgentError>
Source§impl Client
impl Client
Sourcepub fn list_flow_execution_events(&self) -> ListFlowExecutionEventsFluentBuilder
pub fn list_flow_execution_events(&self) -> ListFlowExecutionEventsFluentBuilder
Constructs a fluent builder for the ListFlowExecutionEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: trueThe unique identifier of the flow alias used for the execution.
execution_identifier(impl Into<String>)
/set_execution_identifier(Option<String>)
:
required: trueThe unique identifier of the flow execution.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of events to return in a single response. If more events exist than the specified maxResults value, a token is included in the response so that the remaining results can be retrieved.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA token to retrieve the next set of results. This value is returned in the response if more results are available.
event_type(FlowExecutionEventType)
/set_event_type(Option<FlowExecutionEventType>)
:
required: trueThe type of events to retrieve. Specify
Node
for node-level events orFlow
for flow-level events.
- On success, responds with
ListFlowExecutionEventsOutput
with field(s):flow_execution_events(Vec::<FlowExecutionEvent>)
:A list of events that occurred during the flow execution. Events can include node inputs and outputs, flow inputs and outputs, condition results, and failure events.
next_token(Option<String>)
:A token to retrieve the next set of results. This value is returned if more results are available.
- On failure, responds with
SdkError<ListFlowExecutionEventsError>
Source§impl Client
impl Client
Sourcepub fn list_flow_executions(&self) -> ListFlowExecutionsFluentBuilder
pub fn list_flow_executions(&self) -> ListFlowExecutionsFluentBuilder
Constructs a fluent builder for the ListFlowExecutions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow to list executions for.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: falseThe unique identifier of the flow alias to list executions for.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of flow executions to return in a single response. If more executions exist than the specified
maxResults
value, a token is included in the response so that the remaining results can be retrieved.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA token to retrieve the next set of results. This value is returned in the response if more results are available.
- On success, responds with
ListFlowExecutionsOutput
with field(s):flow_execution_summaries(Vec::<FlowExecutionSummary>)
:A list of flow execution summaries. Each summary includes the execution ARN, flow identifier, flow alias identifier, flow version, status, and timestamps.
next_token(Option<String>)
:A token to retrieve the next set of results. This value is returned if more results are available.
- On failure, responds with
SdkError<ListFlowExecutionsError>
Source§impl Client
impl Client
Sourcepub fn list_invocation_steps(&self) -> ListInvocationStepsFluentBuilder
pub fn list_invocation_steps(&self) -> ListInvocationStepsFluentBuilder
Constructs a fluent builder for the ListInvocationSteps
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
invocation_identifier(impl Into<String>)
/set_invocation_identifier(Option<String>)
:
required: falseThe unique identifier (in UUID format) for the invocation to list invocation steps for.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the session associated with the invocation steps. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
ListInvocationStepsOutput
with field(s):invocation_step_summaries(Vec::<InvocationStepSummary>)
:A list of summaries for each invocation step associated with a session and if you specified it, an invocation within the session.
next_token(Option<String>)
:If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.
- On failure, responds with
SdkError<ListInvocationStepsError>
Source§impl Client
impl Client
Sourcepub fn list_invocations(&self) -> ListInvocationsFluentBuilder
pub fn list_invocations(&self) -> ListInvocationsFluentBuilder
Constructs a fluent builder for the ListInvocations
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the session to list invocations for. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
ListInvocationsOutput
with field(s):invocation_summaries(Vec::<InvocationSummary>)
:A list of invocation summaries associated with the session.
next_token(Option<String>)
:If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.
- On failure, responds with
SdkError<ListInvocationsError>
Source§impl Client
impl Client
Sourcepub fn list_sessions(&self) -> ListSessionsFluentBuilder
pub fn list_sessions(&self) -> ListSessionsFluentBuilder
Constructs a fluent builder for the ListSessions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the
nextToken
field when making another request to return the next batch of results.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the total number of results is greater than the
maxResults
value provided in the request, enter the token returned in thenextToken
field in the response in this field to return the next batch of results.
- On success, responds with
ListSessionsOutput
with field(s):session_summaries(Vec::<SessionSummary>)
:A list of summaries for each session in your Amazon Web Services account.
next_token(Option<String>)
:If the total number of results is greater than the
maxResults
value provided in the request, use this token when making another request in thenextToken
field to return the next batch of results.
- On failure, responds with
SdkError<ListSessionsError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource for which to list tags.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The key-value pairs for the tags associated with the resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn optimize_prompt(&self) -> OptimizePromptFluentBuilder
pub fn optimize_prompt(&self) -> OptimizePromptFluentBuilder
Constructs a fluent builder for the OptimizePrompt
operation.
- The fluent builder is configurable:
input(InputPrompt)
/set_input(Option<InputPrompt>)
:
required: trueContains the prompt to optimize.
target_model_id(impl Into<String>)
/set_target_model_id(Option<String>)
:
required: trueThe unique identifier of the model that you want to optimize the prompt for.
- On success, responds with
OptimizePromptOutput
with field(s):optimized_prompt(EventReceiver<OptimizedPromptStream, OptimizedPromptStreamError>)
:The prompt after being optimized for the task.
- On failure, responds with
SdkError<OptimizePromptError>
Source§impl Client
impl Client
Sourcepub fn put_invocation_step(&self) -> PutInvocationStepFluentBuilder
pub fn put_invocation_step(&self) -> PutInvocationStepFluentBuilder
Constructs a fluent builder for the PutInvocationStep
operation.
- The fluent builder is configurable:
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier for the session to add the invocation step to. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).invocation_identifier(impl Into<String>)
/set_invocation_identifier(Option<String>)
:
required: trueThe unique identifier (in UUID format) of the invocation to add the invocation step to.
invocation_step_time(DateTime)
/set_invocation_step_time(Option<DateTime>)
:
required: trueThe timestamp for when the invocation step occurred.
payload(InvocationStepPayload)
/set_payload(Option<InvocationStepPayload>)
:
required: trueThe payload for the invocation step, including text and images for the interaction.
invocation_step_id(impl Into<String>)
/set_invocation_step_id(Option<String>)
:
required: falseThe unique identifier of the invocation step in UUID format.
- On success, responds with
PutInvocationStepOutput
with field(s):invocation_step_id(String)
:The unique identifier of the invocation step in UUID format.
- On failure, responds with
SdkError<PutInvocationStepError>
Source§impl Client
impl Client
Sourcepub fn rerank(&self) -> RerankFluentBuilder
pub fn rerank(&self) -> RerankFluentBuilder
Constructs a fluent builder for the Rerank
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
queries(RerankQuery)
/set_queries(Option<Vec::<RerankQuery>>)
:
required: trueAn array of objects, each of which contains information about a query to submit to the reranker model.
sources(RerankSource)
/set_sources(Option<Vec::<RerankSource>>)
:
required: trueAn array of objects, each of which contains information about the sources to rerank.
reranking_configuration(RerankingConfiguration)
/set_reranking_configuration(Option<RerankingConfiguration>)
:
required: trueContains configurations for reranking.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the total number of results was greater than could fit in a response, a token is returned in the
nextToken
field. You can enter that token in this field to return the next batch of results.
- On success, responds with
RerankOutput
with field(s):results(Vec::<RerankResult>)
:An array of objects, each of which contains information about the results of reranking.
next_token(Option<String>)
:If the total number of results is greater than can fit in the response, use this token in the
nextToken
field when making another request to return the next batch of results.
- On failure, responds with
SdkError<RerankError>
Source§impl Client
impl Client
Sourcepub fn retrieve(&self) -> RetrieveFluentBuilder
pub fn retrieve(&self) -> RetrieveFluentBuilder
Constructs a fluent builder for the Retrieve
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
knowledge_base_id(impl Into<String>)
/set_knowledge_base_id(Option<String>)
:
required: trueThe unique identifier of the knowledge base to query.
retrieval_query(KnowledgeBaseQuery)
/set_retrieval_query(Option<KnowledgeBaseQuery>)
:
required: trueContains the query to send the knowledge base.
retrieval_configuration(KnowledgeBaseRetrievalConfiguration)
/set_retrieval_configuration(Option<KnowledgeBaseRetrievalConfiguration>)
:
required: falseContains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
guardrail_configuration(GuardrailConfiguration)
/set_guardrail_configuration(Option<GuardrailConfiguration>)
:
required: falseGuardrail settings.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf there are more results than can fit in the response, the response returns a
nextToken
. Use this token in thenextToken
field of another request to retrieve the next batch of results.
- On success, responds with
RetrieveOutput
with field(s):retrieval_results(Vec::<KnowledgeBaseRetrievalResult>)
:A list of results from querying the knowledge base.
guardrail_action(Option<GuadrailAction>)
:Specifies if there is a guardrail intervention in the response.
next_token(Option<String>)
:If there are more results than can fit in the response, the response returns a
nextToken
. Use this token in thenextToken
field of another request to retrieve the next batch of results.
- On failure, responds with
SdkError<RetrieveError>
Source§impl Client
impl Client
Sourcepub fn retrieve_and_generate(&self) -> RetrieveAndGenerateFluentBuilder
pub fn retrieve_and_generate(&self) -> RetrieveAndGenerateFluentBuilder
Constructs a fluent builder for the RetrieveAndGenerate
operation.
- The fluent builder is configurable:
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: falseThe unique identifier of the session. When you first make a
RetrieveAndGenerate
request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can’t explicitly set thesessionId
yourself.input(RetrieveAndGenerateInput)
/set_input(Option<RetrieveAndGenerateInput>)
:
required: trueContains the query to be made to the knowledge base.
retrieve_and_generate_configuration(RetrieveAndGenerateConfiguration)
/set_retrieve_and_generate_configuration(Option<RetrieveAndGenerateConfiguration>)
:
required: falseContains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
session_configuration(RetrieveAndGenerateSessionConfiguration)
/set_session_configuration(Option<RetrieveAndGenerateSessionConfiguration>)
:
required: falseContains details about the session with the knowledge base.
- On success, responds with
RetrieveAndGenerateOutput
with field(s):session_id(String)
:The unique identifier of the session. When you first make a
RetrieveAndGenerate
request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can’t explicitly set thesessionId
yourself.output(Option<RetrieveAndGenerateOutput>)
:Contains the response generated from querying the knowledge base.
citations(Option<Vec::<Citation>>)
:A list of segments of the generated response that are based on sources in the knowledge base, alongside information about the sources.
guardrail_action(Option<GuadrailAction>)
:Specifies if there is a guardrail intervention in the response.
- On failure, responds with
SdkError<RetrieveAndGenerateError>
Source§impl Client
impl Client
Sourcepub fn retrieve_and_generate_stream(
&self,
) -> RetrieveAndGenerateStreamFluentBuilder
pub fn retrieve_and_generate_stream( &self, ) -> RetrieveAndGenerateStreamFluentBuilder
Constructs a fluent builder for the RetrieveAndGenerateStream
operation.
- The fluent builder is configurable:
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: falseThe unique identifier of the session. When you first make a
RetrieveAndGenerate
request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can’t explicitly set thesessionId
yourself.input(RetrieveAndGenerateInput)
/set_input(Option<RetrieveAndGenerateInput>)
:
required: trueContains the query to be made to the knowledge base.
retrieve_and_generate_configuration(RetrieveAndGenerateConfiguration)
/set_retrieve_and_generate_configuration(Option<RetrieveAndGenerateConfiguration>)
:
required: falseContains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
session_configuration(RetrieveAndGenerateSessionConfiguration)
/set_session_configuration(Option<RetrieveAndGenerateSessionConfiguration>)
:
required: falseContains details about the session with the knowledge base.
- On success, responds with
RetrieveAndGenerateStreamOutput
with field(s):stream(EventReceiver<RetrieveAndGenerateStreamResponseOutput, RetrieveAndGenerateStreamResponseOutputError>)
:A stream of events from the model.
session_id(String)
:The session ID.
- On failure, responds with
SdkError<RetrieveAndGenerateStreamError>
Source§impl Client
impl Client
Sourcepub fn start_flow_execution(&self) -> StartFlowExecutionFluentBuilder
pub fn start_flow_execution(&self) -> StartFlowExecutionFluentBuilder
Constructs a fluent builder for the StartFlowExecution
operation.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow to execute.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: trueThe unique identifier of the flow alias to use for the flow execution.
flow_execution_name(impl Into<String>)
/set_flow_execution_name(Option<String>)
:
required: falseThe unique name for the flow execution. If you don’t provide one, a system-generated name is used.
inputs(FlowInput)
/set_inputs(Option<Vec::<FlowInput>>)
:
required: trueThe input data required for the flow execution. This must match the input schema defined in the flow.
model_performance_configuration(ModelPerformanceConfiguration)
/set_model_performance_configuration(Option<ModelPerformanceConfiguration>)
:
required: falseThe performance settings for the foundation model used in the flow execution.
- On success, responds with
StartFlowExecutionOutput
with field(s):execution_arn(Option<String>)
:The Amazon Resource Name (ARN) that uniquely identifies the flow execution.
- On failure, responds with
SdkError<StartFlowExecutionError>
Source§impl Client
impl Client
Sourcepub fn stop_flow_execution(&self) -> StopFlowExecutionFluentBuilder
pub fn stop_flow_execution(&self) -> StopFlowExecutionFluentBuilder
Constructs a fluent builder for the StopFlowExecution
operation.
- The fluent builder is configurable:
flow_identifier(impl Into<String>)
/set_flow_identifier(Option<String>)
:
required: trueThe unique identifier of the flow.
flow_alias_identifier(impl Into<String>)
/set_flow_alias_identifier(Option<String>)
:
required: trueThe unique identifier of the flow alias used for the execution.
execution_identifier(impl Into<String>)
/set_execution_identifier(Option<String>)
:
required: trueThe unique identifier of the flow execution to stop.
- On success, responds with
StopFlowExecutionOutput
with field(s):execution_arn(Option<String>)
:The Amazon Resource Name (ARN) that uniquely identifies the flow execution that was stopped.
status(FlowExecutionStatus)
:The updated status of the flow execution after the stop request. This will typically be ABORTED if the execution was successfully stopped.
- On failure, responds with
SdkError<StopFlowExecutionError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to tag.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueAn object containing key-value pairs that define the tags to attach to the resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource from which to remove tags.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueA list of keys of the tags to remove from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_session(&self) -> UpdateSessionFluentBuilder
pub fn update_session(&self) -> UpdateSessionFluentBuilder
Constructs a fluent builder for the UpdateSession
operation.
- The fluent builder is configurable:
session_metadata(impl Into<String>, impl Into<String>)
/set_session_metadata(Option<HashMap::<String, String>>)
:
required: falseA map of key-value pairs containing attributes to be persisted across the session. For example the user’s ID, their language preference, and the type of device they are using.
session_identifier(impl Into<String>)
/set_session_identifier(Option<String>)
:
required: trueThe unique identifier of the session to modify. You can specify either the session’s
sessionId
or its Amazon Resource Name (ARN).
- On success, responds with
UpdateSessionOutput
with field(s):session_id(String)
:The unique identifier of the session you updated.
session_arn(String)
:The Amazon Resource Name (ARN) of the session that was updated.
session_status(SessionStatus)
:The status of the session you updated.
created_at(DateTime)
:The timestamp for when the session was created.
last_updated_at(DateTime)
:The timestamp for when the session was last modified.
- On failure, responds with
SdkError<UpdateSessionError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);