pub struct Client { /* private fields */ }
Expand description
Client for Amazon Bedrock AgentCore Data Plane Fronting Layer
Client for invoking operations on Amazon Bedrock AgentCore Data Plane Fronting Layer. Each operation on Amazon Bedrock AgentCore Data Plane Fronting Layer 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_bedrockagentcore::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_bedrockagentcore::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 BatchCreateMemoryRecords
operation has
a Client::batch_create_memory_records
, 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.batch_create_memory_records()
.memory_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 batch_create_memory_records(
&self,
) -> BatchCreateMemoryRecordsFluentBuilder
pub fn batch_create_memory_records( &self, ) -> BatchCreateMemoryRecordsFluentBuilder
Constructs a fluent builder for the BatchCreateMemoryRecords
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe unique ID of the memory resource where records will be created.
records(MemoryRecordCreateInput)
/set_records(Option<Vec::<MemoryRecordCreateInput>>)
:
required: trueA list of memory record creation inputs to be processed in the batch operation.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure idempotent processing of the batch request.
- On success, responds with
BatchCreateMemoryRecordsOutput
with field(s):successful_records(Vec::<MemoryRecordOutput>)
:A list of memory records that were successfully created during the batch operation.
failed_records(Vec::<MemoryRecordOutput>)
:A list of memory records that failed to be created, including error details for each failure.
- On failure, responds with
SdkError<BatchCreateMemoryRecordsError>
Source§impl Client
impl Client
Sourcepub fn batch_delete_memory_records(
&self,
) -> BatchDeleteMemoryRecordsFluentBuilder
pub fn batch_delete_memory_records( &self, ) -> BatchDeleteMemoryRecordsFluentBuilder
Constructs a fluent builder for the BatchDeleteMemoryRecords
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe unique ID of the memory resource where records will be deleted.
records(MemoryRecordDeleteInput)
/set_records(Option<Vec::<MemoryRecordDeleteInput>>)
:
required: trueA list of memory record deletion inputs to be processed in the batch operation.
- On success, responds with
BatchDeleteMemoryRecordsOutput
with field(s):successful_records(Vec::<MemoryRecordOutput>)
:A list of memory records that were successfully deleted during the batch operation.
failed_records(Vec::<MemoryRecordOutput>)
:A list of memory records that failed to be deleted, including error details for each failure.
- On failure, responds with
SdkError<BatchDeleteMemoryRecordsError>
Source§impl Client
impl Client
Sourcepub fn batch_update_memory_records(
&self,
) -> BatchUpdateMemoryRecordsFluentBuilder
pub fn batch_update_memory_records( &self, ) -> BatchUpdateMemoryRecordsFluentBuilder
Constructs a fluent builder for the BatchUpdateMemoryRecords
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe unique ID of the memory resource where records will be updated.
records(MemoryRecordUpdateInput)
/set_records(Option<Vec::<MemoryRecordUpdateInput>>)
:
required: trueA list of memory record update inputs to be processed in the batch operation.
- On success, responds with
BatchUpdateMemoryRecordsOutput
with field(s):successful_records(Vec::<MemoryRecordOutput>)
:A list of memory records that were successfully updated during the batch operation.
failed_records(Vec::<MemoryRecordOutput>)
:A list of memory records that failed to be updated, including error details for each failure.
- On failure, responds with
SdkError<BatchUpdateMemoryRecordsError>
Source§impl Client
impl Client
Sourcepub fn complete_resource_token_auth(
&self,
) -> CompleteResourceTokenAuthFluentBuilder
pub fn complete_resource_token_auth( &self, ) -> CompleteResourceTokenAuthFluentBuilder
Constructs a fluent builder for the CompleteResourceTokenAuth
operation.
- The fluent builder is configurable:
user_identifier(UserIdentifier)
/set_user_identifier(Option<UserIdentifier>)
:
required: trueThe OAuth2.0 token or user ID that was used to generate the workload access token used for initiating the user authorization flow to retrieve OAuth2.0 tokens.
session_uri(impl Into<String>)
/set_session_uri(Option<String>)
:
required: trueUnique identifier for the user’s authentication session for retrieving OAuth2 tokens. This ID tracks the authorization flow state across multiple requests and responses during the OAuth2 authentication process.
- On success, responds with
CompleteResourceTokenAuthOutput
- On failure, responds with
SdkError<CompleteResourceTokenAuthError>
Source§impl Client
impl Client
Sourcepub fn create_event(&self) -> CreateEventFluentBuilder
pub fn create_event(&self) -> CreateEventFluentBuilder
Constructs a fluent builder for the CreateEvent
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource in which to create the event.
actor_id(impl Into<String>)
/set_actor_id(Option<String>)
:
required: trueThe identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: falseThe identifier of the session in which this event occurs. A session represents a sequence of related events.
event_timestamp(DateTime)
/set_event_timestamp(Option<DateTime>)
:
required: trueThe timestamp when the event occurred. If not specified, the current time is used.
payload(PayloadType)
/set_payload(Option<Vec::<PayloadType>>)
:
required: trueThe content payload of the event. This can include conversational data or binary content.
branch(Branch)
/set_branch(Option<Branch>)
:
required: falseThe branch information for this event. Branches allow for organizing events into different conversation threads or paths.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.
metadata(impl Into<String>, MetadataValue)
/set_metadata(Option<HashMap::<String, MetadataValue>>)
:
required: falseThe key-value metadata to attach to the event.
- On success, responds with
CreateEventOutput
with field(s):event(Option<Event>)
:The event that was created.
- On failure, responds with
SdkError<CreateEventError>
Source§impl Client
impl Client
Sourcepub fn delete_event(&self) -> DeleteEventFluentBuilder
pub fn delete_event(&self) -> DeleteEventFluentBuilder
Constructs a fluent builder for the DeleteEvent
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource from which to delete the event.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe identifier of the session containing the event to delete.
event_id(impl Into<String>)
/set_event_id(Option<String>)
:
required: trueThe identifier of the event to delete.
actor_id(impl Into<String>)
/set_actor_id(Option<String>)
:
required: trueThe identifier of the actor associated with the event to delete.
- On success, responds with
DeleteEventOutput
with field(s):event_id(String)
:The identifier of the event that was deleted.
- On failure, responds with
SdkError<DeleteEventError>
Source§impl Client
impl Client
Sourcepub fn delete_memory_record(&self) -> DeleteMemoryRecordFluentBuilder
pub fn delete_memory_record(&self) -> DeleteMemoryRecordFluentBuilder
Constructs a fluent builder for the DeleteMemoryRecord
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource from which to delete the memory record.
memory_record_id(impl Into<String>)
/set_memory_record_id(Option<String>)
:
required: trueThe identifier of the memory record to delete.
- On success, responds with
DeleteMemoryRecordOutput
with field(s):memory_record_id(String)
:The identifier of the memory record that was deleted.
- On failure, responds with
SdkError<DeleteMemoryRecordError>
Source§impl Client
impl Client
Sourcepub fn get_agent_card(&self) -> GetAgentCardFluentBuilder
pub fn get_agent_card(&self) -> GetAgentCardFluentBuilder
Constructs a fluent builder for the GetAgentCard
operation.
- The fluent builder is configurable:
runtime_session_id(impl Into<String>)
/set_runtime_session_id(Option<String>)
:
required: falseThe session ID that the AgentCore Runtime agent is using.
agent_runtime_arn(impl Into<String>)
/set_agent_runtime_arn(Option<String>)
:
required: trueThe ARN of the AgentCore Runtime agent for which you want to get the A2A agent card.
qualifier(impl Into<String>)
/set_qualifier(Option<String>)
:
required: falseOptional qualifier to specify an agent alias, such as
prod
code> ordev
. If you don’t provide a value, the DEFAULT alias is used.
- On success, responds with
GetAgentCardOutput
with field(s):runtime_session_id(Option<String>)
:The ID of the session associated with the AgentCore Runtime agent.
agent_card(Document)
:An agent card document that contains metadata and capabilities for an AgentCore Runtime agent.
status_code(Option<i32>)
:The status code of the request.
- On failure, responds with
SdkError<GetAgentCardError>
Source§impl Client
impl Client
Sourcepub fn get_browser_session(&self) -> GetBrowserSessionFluentBuilder
pub fn get_browser_session(&self) -> GetBrowserSessionFluentBuilder
Constructs a fluent builder for the GetBrowserSession
operation.
- The fluent builder is configurable:
browser_identifier(impl Into<String>)
/set_browser_identifier(Option<String>)
:
required: trueThe unique identifier of the browser associated with the session.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe unique identifier of the browser session to retrieve.
- On success, responds with
GetBrowserSessionOutput
with field(s):browser_identifier(String)
:The identifier of the browser.
session_id(String)
:The identifier of the browser session.
name(Option<String>)
:The name of the browser session.
created_at(DateTime)
:The time at which the browser session was created.
view_port(Option<ViewPort>)
:The configuration that defines the dimensions of a browser viewport in a browser session. The viewport determines the visible area of web content and affects how web pages are rendered and displayed. Proper viewport configuration ensures that web content is displayed correctly for the agent’s browsing tasks.
session_timeout_seconds(Option<i32>)
:The timeout period for the browser session in seconds.
status(Option<BrowserSessionStatus>)
:The current status of the browser session. Possible values include ACTIVE, STOPPING, and STOPPED.
streams(Option<BrowserSessionStream>)
:The streams associated with this browser session. These include the automation stream and live view stream.
session_replay_artifact(Option<String>)
:The artifact containing the session replay information.
last_updated_at(Option<DateTime>)
:The time at which the browser session was last updated.
- On failure, responds with
SdkError<GetBrowserSessionError>
Source§impl Client
impl Client
Sourcepub fn get_code_interpreter_session(
&self,
) -> GetCodeInterpreterSessionFluentBuilder
pub fn get_code_interpreter_session( &self, ) -> GetCodeInterpreterSessionFluentBuilder
Constructs a fluent builder for the GetCodeInterpreterSession
operation.
- The fluent builder is configurable:
code_interpreter_identifier(impl Into<String>)
/set_code_interpreter_identifier(Option<String>)
:
required: trueThe unique identifier of the code interpreter associated with the session.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe unique identifier of the code interpreter session to retrieve.
- On success, responds with
GetCodeInterpreterSessionOutput
with field(s):code_interpreter_identifier(String)
:The identifier of the code interpreter.
session_id(String)
:The identifier of the code interpreter session.
name(Option<String>)
:The name of the code interpreter session.
created_at(DateTime)
:The time at which the code interpreter session was created.
session_timeout_seconds(Option<i32>)
:The timeout period for the code interpreter session in seconds.
status(Option<CodeInterpreterSessionStatus>)
:The current status of the code interpreter session. Possible values include ACTIVE, STOPPING, and STOPPED.
- On failure, responds with
SdkError<GetCodeInterpreterSessionError>
Source§impl Client
impl Client
Sourcepub fn get_event(&self) -> GetEventFluentBuilder
pub fn get_event(&self) -> GetEventFluentBuilder
Constructs a fluent builder for the GetEvent
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource containing the event.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe identifier of the session containing the event.
actor_id(impl Into<String>)
/set_actor_id(Option<String>)
:
required: trueThe identifier of the actor associated with the event.
event_id(impl Into<String>)
/set_event_id(Option<String>)
:
required: trueThe identifier of the event to retrieve.
- On success, responds with
GetEventOutput
with field(s):event(Option<Event>)
:The requested event information.
- On failure, responds with
SdkError<GetEventError>
Source§impl Client
impl Client
Sourcepub fn get_memory_record(&self) -> GetMemoryRecordFluentBuilder
pub fn get_memory_record(&self) -> GetMemoryRecordFluentBuilder
Constructs a fluent builder for the GetMemoryRecord
operation.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource containing the memory record.
memory_record_id(impl Into<String>)
/set_memory_record_id(Option<String>)
:
required: trueThe identifier of the memory record to retrieve.
- On success, responds with
GetMemoryRecordOutput
with field(s):memory_record(Option<MemoryRecord>)
:The requested memory record.
- On failure, responds with
SdkError<GetMemoryRecordError>
Source§impl Client
impl Client
Sourcepub fn get_resource_api_key(&self) -> GetResourceApiKeyFluentBuilder
pub fn get_resource_api_key(&self) -> GetResourceApiKeyFluentBuilder
Constructs a fluent builder for the GetResourceApiKey
operation.
- The fluent builder is configurable:
workload_identity_token(impl Into<String>)
/set_workload_identity_token(Option<String>)
:
required: trueThe identity token of the workload from which you want to retrieve the API key.
resource_credential_provider_name(impl Into<String>)
/set_resource_credential_provider_name(Option<String>)
:
required: trueThe credential provider name for the resource from which you are retrieving the API key.
- On success, responds with
GetResourceApiKeyOutput
with field(s):api_key(String)
:The API key associated with the resource requested.
- On failure, responds with
SdkError<GetResourceApiKeyError>
Source§impl Client
impl Client
Sourcepub fn get_resource_oauth2_token(&self) -> GetResourceOauth2TokenFluentBuilder
pub fn get_resource_oauth2_token(&self) -> GetResourceOauth2TokenFluentBuilder
Constructs a fluent builder for the GetResourceOauth2Token
operation.
- The fluent builder is configurable:
workload_identity_token(impl Into<String>)
/set_workload_identity_token(Option<String>)
:
required: trueThe identity token of the workload from which you want to retrieve the OAuth2 token.
resource_credential_provider_name(impl Into<String>)
/set_resource_credential_provider_name(Option<String>)
:
required: trueThe name of the resource’s credential provider.
scopes(impl Into<String>)
/set_scopes(Option<Vec::<String>>)
:
required: trueThe OAuth scopes being requested.
oauth2_flow(Oauth2FlowType)
/set_oauth2_flow(Option<Oauth2FlowType>)
:
required: trueThe type of flow to be performed.
session_uri(impl Into<String>)
/set_session_uri(Option<String>)
:
required: falseUnique identifier for the user’s authentication session for retrieving OAuth2 tokens. This ID tracks the authorization flow state across multiple requests and responses during the OAuth2 authentication process.
resource_oauth2_return_url(impl Into<String>)
/set_resource_oauth2_return_url(Option<String>)
:
required: falseThe callback URL to redirect to after the OAuth 2.0 token retrieval is complete. This URL must be one of the provided URLs configured for the workload identity.
force_authentication(bool)
/set_force_authentication(Option<bool>)
:
required: falseIndicates whether to always initiate a new three-legged OAuth (3LO) flow, regardless of any existing session.
custom_parameters(impl Into<String>, impl Into<String>)
/set_custom_parameters(Option<HashMap::<String, String>>)
:
required: falseA map of custom parameters to include in the authorization request to the resource credential provider. These parameters are in addition to the standard OAuth 2.0 flow parameters, and will not override them.
custom_state(impl Into<String>)
/set_custom_state(Option<String>)
:
required: falseAn opaque string that will be sent back to the callback URL provided in resourceOauth2ReturnUrl. This state should be used to protect the callback URL of your application against CSRF attacks by ensuring the response corresponds to the original request.
- On success, responds with
GetResourceOauth2TokenOutput
with field(s):authorization_url(Option<String>)
:The URL to initiate the authorization process, provided when the access token requires user authorization.
access_token(Option<String>)
:The OAuth 2.0 access token to use.
session_uri(Option<String>)
:Unique identifier for the user’s authorization session for retrieving OAuth2 tokens. This matches the sessionId from the request and can be used to track the session state.
session_status(Option<SessionStatus>)
:Status indicating whether the user’s authorization session is in progress or has failed. This helps determine the next steps in the OAuth2 authentication flow.
- On failure, responds with
SdkError<GetResourceOauth2TokenError>
Source§impl Client
impl Client
Sourcepub fn get_workload_access_token(&self) -> GetWorkloadAccessTokenFluentBuilder
pub fn get_workload_access_token(&self) -> GetWorkloadAccessTokenFluentBuilder
Constructs a fluent builder for the GetWorkloadAccessToken
operation.
- The fluent builder is configurable:
workload_name(impl Into<String>)
/set_workload_name(Option<String>)
:
required: trueThe unique identifier for the registered workload.
- On success, responds with
GetWorkloadAccessTokenOutput
with field(s):workload_access_token(String)
:An opaque token representing the identity of both the workload and the user.
- On failure, responds with
SdkError<GetWorkloadAccessTokenError>
Source§impl Client
impl Client
Sourcepub fn get_workload_access_token_for_jwt(
&self,
) -> GetWorkloadAccessTokenForJWTFluentBuilder
pub fn get_workload_access_token_for_jwt( &self, ) -> GetWorkloadAccessTokenForJWTFluentBuilder
Constructs a fluent builder for the GetWorkloadAccessTokenForJWT
operation.
- The fluent builder is configurable:
workload_name(impl Into<String>)
/set_workload_name(Option<String>)
:
required: trueThe unique identifier for the registered workload.
user_token(impl Into<String>)
/set_user_token(Option<String>)
:
required: trueThe OAuth 2.0 token issued by the user’s identity provider.
- On success, responds with
GetWorkloadAccessTokenForJwtOutput
with field(s):workload_access_token(String)
:An opaque token representing the identity of both the workload and the user.
- On failure, responds with
SdkError<GetWorkloadAccessTokenForJWTError>
Source§impl Client
impl Client
Sourcepub fn get_workload_access_token_for_user_id(
&self,
) -> GetWorkloadAccessTokenForUserIdFluentBuilder
pub fn get_workload_access_token_for_user_id( &self, ) -> GetWorkloadAccessTokenForUserIdFluentBuilder
Constructs a fluent builder for the GetWorkloadAccessTokenForUserId
operation.
- The fluent builder is configurable:
workload_name(impl Into<String>)
/set_workload_name(Option<String>)
:
required: trueThe name of the workload from which you want to retrieve the access token.
user_id(impl Into<String>)
/set_user_id(Option<String>)
:
required: trueThe ID of the user for whom you are retrieving the access token.
- On success, responds with
GetWorkloadAccessTokenForUserIdOutput
with field(s):workload_access_token(String)
:The access token for the specified workload.
- On failure, responds with
SdkError<GetWorkloadAccessTokenForUserIdError>
Source§impl Client
impl Client
Sourcepub fn invoke_agent_runtime(&self) -> InvokeAgentRuntimeFluentBuilder
pub fn invoke_agent_runtime(&self) -> InvokeAgentRuntimeFluentBuilder
Constructs a fluent builder for the InvokeAgentRuntime
operation.
- The fluent builder is configurable:
content_type(impl Into<String>)
/set_content_type(Option<String>)
:
required: falseThe MIME type of the input data in the payload. This tells the agent runtime how to interpret the payload data. Common values include application/json for JSON data.
accept(impl Into<String>)
/set_accept(Option<String>)
:
required: falseThe desired MIME type for the response from the agent runtime. This tells the agent runtime what format to use for the response data. Common values include application/json for JSON data.
mcp_session_id(impl Into<String>)
/set_mcp_session_id(Option<String>)
:
required: falseThe identifier of the MCP session.
runtime_session_id(impl Into<String>)
/set_runtime_session_id(Option<String>)
:
required: falseThe identifier of the runtime session.
mcp_protocol_version(impl Into<String>)
/set_mcp_protocol_version(Option<String>)
:
required: falseThe version of the MCP protocol being used.
runtime_user_id(impl Into<String>)
/set_runtime_user_id(Option<String>)
:
required: falseThe identifier of the runtime user.
trace_id(impl Into<String>)
/set_trace_id(Option<String>)
:
required: falseThe trace identifier for request tracking.
trace_parent(impl Into<String>)
/set_trace_parent(Option<String>)
:
required: falseThe parent trace information for distributed tracing.
trace_state(impl Into<String>)
/set_trace_state(Option<String>)
:
required: falseThe trace state information for distributed tracing.
baggage(impl Into<String>)
/set_baggage(Option<String>)
:
required: falseAdditional context information for distributed tracing.
agent_runtime_arn(impl Into<String>)
/set_agent_runtime_arn(Option<String>)
:
required: trueThe Amazon Web Services Resource Name (ARN) of the agent runtime to invoke. The ARN uniquely identifies the agent runtime resource in Amazon Bedrock.
qualifier(impl Into<String>)
/set_qualifier(Option<String>)
:
required: falseThe qualifier to use for the agent runtime. This can be a version number or an endpoint name that points to a specific version. If not specified, Amazon Bedrock uses the default version of the agent runtime.
account_id(impl Into<String>)
/set_account_id(Option<String>)
:
required: falseThe identifier of the Amazon Web Services account for the agent runtime resource.
payload(Blob)
/set_payload(Option<Blob>)
:
required: trueThe input data to send to the agent runtime. The format of this data depends on the specific agent configuration and must match the specified content type. For most agents, this is a JSON object containing the user’s request.
- On success, responds with
InvokeAgentRuntimeOutput
with field(s):runtime_session_id(Option<String>)
:The identifier of the runtime session.
mcp_session_id(Option<String>)
:The identifier of the MCP session.
mcp_protocol_version(Option<String>)
:The version of the MCP protocol being used.
trace_id(Option<String>)
:The trace identifier for request tracking.
trace_parent(Option<String>)
:The parent trace information for distributed tracing.
trace_state(Option<String>)
:The trace state information for distributed tracing.
baggage(Option<String>)
:Additional context information for distributed tracing.
content_type(String)
:The MIME type of the response data. This indicates how to interpret the response data. Common values include application/json for JSON data.
response(ByteStream)
:The response data from the agent runtime. The format of this data depends on the specific agent configuration and the requested accept type. For most agents, this is a JSON object containing the agent’s response to the user’s request.
status_code(Option<i32>)
:The HTTP status code of the response. A status code of 200 indicates a successful operation. Other status codes indicate various error conditions.
- On failure, responds with
SdkError<InvokeAgentRuntimeError>
Source§impl Client
impl Client
Sourcepub fn invoke_code_interpreter(&self) -> InvokeCodeInterpreterFluentBuilder
pub fn invoke_code_interpreter(&self) -> InvokeCodeInterpreterFluentBuilder
Constructs a fluent builder for the InvokeCodeInterpreter
operation.
- The fluent builder is configurable:
code_interpreter_identifier(impl Into<String>)
/set_code_interpreter_identifier(Option<String>)
:
required: trueThe unique identifier of the code interpreter associated with the session. This must match the identifier used when creating the session with
StartCodeInterpreterSession
.session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: falseThe unique identifier of the code interpreter session to use. This must be an active session created with
StartCodeInterpreterSession
. If the session has expired or been stopped, the request will fail.trace_id(impl Into<String>)
/set_trace_id(Option<String>)
:
required: falseThe trace identifier for request tracking.
trace_parent(impl Into<String>)
/set_trace_parent(Option<String>)
:
required: falseThe parent trace information for distributed tracing.
name(ToolName)
/set_name(Option<ToolName>)
:
required: trueThe name of the code interpreter to invoke.
arguments(ToolArguments)
/set_arguments(Option<ToolArguments>)
:
required: falseThe arguments for the code interpreter. This includes the code to execute and any additional parameters such as the programming language, whether to clear the execution context, and other execution options. The structure of this parameter depends on the specific code interpreter being used.
- On success, responds with
InvokeCodeInterpreterOutput
with field(s):session_id(Option<String>)
:The identifier of the code interpreter session.
stream(EventReceiver<CodeInterpreterStreamOutput, CodeInterpreterStreamOutputError>)
:The stream containing the results of the code execution. This includes output, errors, and execution status.
- On failure, responds with
SdkError<InvokeCodeInterpreterError>
Source§impl Client
impl Client
Sourcepub fn list_actors(&self) -> ListActorsFluentBuilder
pub fn list_actors(&self) -> ListActorsFluentBuilder
Constructs a fluent builder for the ListActors
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource for which to list actors.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListActorsOutput
with field(s):actor_summaries(Vec::<ActorSummary>)
:The list of actor summaries.
next_token(Option<String>)
:The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListActorsError>
Source§impl Client
impl Client
Sourcepub fn list_browser_sessions(&self) -> ListBrowserSessionsFluentBuilder
pub fn list_browser_sessions(&self) -> ListBrowserSessionsFluentBuilder
Constructs a fluent builder for the ListBrowserSessions
operation.
- The fluent builder is configurable:
browser_identifier(impl Into<String>)
/set_browser_identifier(Option<String>)
:
required: trueThe unique identifier of the browser to list sessions for. If specified, only sessions for this browser are returned. If not specified, sessions for all browsers are returned.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. The default value is 10. Valid values range from 1 to 100. To retrieve the remaining results, make another call with the returned
nextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. If not specified, Amazon Bedrock returns the first page of results.
status(BrowserSessionStatus)
/set_status(Option<BrowserSessionStatus>)
:
required: falseThe status of the browser sessions to list. Valid values include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with any status are returned.
- On success, responds with
ListBrowserSessionsOutput
with field(s):items(Vec::<BrowserSessionSummary>)
:The list of browser sessions that match the specified criteria.
next_token(Option<String>)
:The token to use in a subsequent
ListBrowserSessions
request to get the next set of results.
- On failure, responds with
SdkError<ListBrowserSessionsError>
Source§impl Client
impl Client
Sourcepub fn list_code_interpreter_sessions(
&self,
) -> ListCodeInterpreterSessionsFluentBuilder
pub fn list_code_interpreter_sessions( &self, ) -> ListCodeInterpreterSessionsFluentBuilder
Constructs a fluent builder for the ListCodeInterpreterSessions
operation.
- The fluent builder is configurable:
code_interpreter_identifier(impl Into<String>)
/set_code_interpreter_identifier(Option<String>)
:
required: trueThe unique identifier of the code interpreter to list sessions for. If specified, only sessions for this code interpreter are returned. If not specified, sessions for all code interpreters are returned.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. The default value is 10. Valid values range from 1 to 100. To retrieve the remaining results, make another call with the returned
nextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. If not specified, Amazon Bedrock returns the first page of results.
status(CodeInterpreterSessionStatus)
/set_status(Option<CodeInterpreterSessionStatus>)
:
required: falseThe status of the code interpreter sessions to list. Valid values include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with any status are returned.
- On success, responds with
ListCodeInterpreterSessionsOutput
with field(s):items(Vec::<CodeInterpreterSessionSummary>)
:The list of code interpreter sessions that match the specified criteria.
next_token(Option<String>)
:The token to use in a subsequent
ListCodeInterpreterSessions
request to get the next set of results.
- On failure, responds with
SdkError<ListCodeInterpreterSessionsError>
Source§impl Client
impl Client
Sourcepub fn list_events(&self) -> ListEventsFluentBuilder
pub fn list_events(&self) -> ListEventsFluentBuilder
Constructs a fluent builder for the ListEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource for which to list events.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe identifier of the session for which to list events. If specified, only events from this session are returned.
actor_id(impl Into<String>)
/set_actor_id(Option<String>)
:
required: trueThe identifier of the actor for which to list events. If specified, only events from this actor are returned.
include_payloads(bool)
/set_include_payloads(Option<bool>)
:
required: falseSpecifies whether to include event payloads in the response. Set to true to include payloads, or false to exclude them.
filter(FilterInput)
/set_filter(Option<FilterInput>)
:
required: falseFilter criteria to apply when listing events.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListEventsOutput
with field(s):events(Vec::<Event>)
:The list of events that match the specified criteria.
next_token(Option<String>)
:The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListEventsError>
Source§impl Client
impl Client
Sourcepub fn list_memory_records(&self) -> ListMemoryRecordsFluentBuilder
pub fn list_memory_records(&self) -> ListMemoryRecordsFluentBuilder
Constructs a fluent builder for the ListMemoryRecords
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource for which to list memory records.
namespace(impl Into<String>)
/set_namespace(Option<String>)
:
required: trueThe namespace to filter memory records by. If specified, only memory records in this namespace are returned.
memory_strategy_id(impl Into<String>)
/set_memory_strategy_id(Option<String>)
:
required: falseThe memory strategy identifier to filter memory records by. If specified, only memory records with this strategy ID are returned.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListMemoryRecordsOutput
with field(s):memory_record_summaries(Vec::<MemoryRecordSummary>)
:The list of memory record summaries that match the specified criteria.
next_token(Option<String>)
:The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListMemoryRecordsError>
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:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource for which to list sessions.
actor_id(impl Into<String>)
/set_actor_id(Option<String>)
:
required: trueThe identifier of the actor for which to list sessions. If specified, only sessions involving this actor are returned.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListSessionsOutput
with field(s):session_summaries(Vec::<SessionSummary>)
:The list of session summaries that match the specified criteria.
next_token(Option<String>)
:The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListSessionsError>
Source§impl Client
impl Client
Sourcepub fn retrieve_memory_records(&self) -> RetrieveMemoryRecordsFluentBuilder
pub fn retrieve_memory_records(&self) -> RetrieveMemoryRecordsFluentBuilder
Constructs a fluent builder for the RetrieveMemoryRecords
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
memory_id(impl Into<String>)
/set_memory_id(Option<String>)
:
required: trueThe identifier of the AgentCore Memory resource from which to retrieve memory records.
namespace(impl Into<String>)
/set_namespace(Option<String>)
:
required: trueThe namespace to filter memory records by. If specified, only memory records in this namespace are searched.
search_criteria(SearchCriteria)
/set_search_criteria(Option<SearchCriteria>)
:
required: trueThe search criteria to use for finding relevant memory records. This includes the search query, memory strategy ID, and other search parameters.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. Minimum value of 1, maximum value of 100. Default is 20.
- On success, responds with
RetrieveMemoryRecordsOutput
with field(s):memory_record_summaries(Vec::<MemoryRecordSummary>)
:The list of memory record summaries that match the search criteria, ordered by relevance.
next_token(Option<String>)
:The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<RetrieveMemoryRecordsError>
Source§impl Client
impl Client
Sourcepub fn start_browser_session(&self) -> StartBrowserSessionFluentBuilder
pub fn start_browser_session(&self) -> StartBrowserSessionFluentBuilder
Constructs a fluent builder for the StartBrowserSession
operation.
- The fluent builder is configurable:
trace_id(impl Into<String>)
/set_trace_id(Option<String>)
:
required: falseThe trace identifier for request tracking.
trace_parent(impl Into<String>)
/set_trace_parent(Option<String>)
:
required: falseThe parent trace information for distributed tracing.
browser_identifier(impl Into<String>)
/set_browser_identifier(Option<String>)
:
required: trueThe unique identifier of the browser to use for this session. This identifier specifies which browser environment to initialize for the session.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name of the browser session. This name helps you identify and manage the session. The name does not need to be unique.
session_timeout_seconds(i32)
/set_session_timeout_seconds(Option<i32>)
:
required: falseThe time in seconds after which the session automatically terminates if there is no activity. The default value is 3600 seconds (1 hour). The minimum allowed value is 60 seconds, and the maximum allowed value is 28800 seconds (8 hours).
view_port(ViewPort)
/set_view_port(Option<ViewPort>)
:
required: falseThe dimensions of the browser viewport for this session. This determines the visible area of the web content and affects how web pages are rendered. If not specified, Amazon Bedrock uses a default viewport size.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.
- On success, responds with
StartBrowserSessionOutput
with field(s):browser_identifier(String)
:The identifier of the browser.
session_id(String)
:The unique identifier of the created browser session.
created_at(DateTime)
:The timestamp when the browser session was created.
streams(Option<BrowserSessionStream>)
:The streams associated with this browser session. These include the automation stream and live view stream.
- On failure, responds with
SdkError<StartBrowserSessionError>
Source§impl Client
impl Client
Sourcepub fn start_code_interpreter_session(
&self,
) -> StartCodeInterpreterSessionFluentBuilder
pub fn start_code_interpreter_session( &self, ) -> StartCodeInterpreterSessionFluentBuilder
Constructs a fluent builder for the StartCodeInterpreterSession
operation.
- The fluent builder is configurable:
trace_id(impl Into<String>)
/set_trace_id(Option<String>)
:
required: falseThe trace identifier for request tracking.
trace_parent(impl Into<String>)
/set_trace_parent(Option<String>)
:
required: falseThe parent trace information for distributed tracing.
code_interpreter_identifier(impl Into<String>)
/set_code_interpreter_identifier(Option<String>)
:
required: trueThe unique identifier of the code interpreter to use for this session. This identifier specifies which code interpreter environment to initialize for the session.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name of the code interpreter session. This name helps you identify and manage the session. The name does not need to be unique.
session_timeout_seconds(i32)
/set_session_timeout_seconds(Option<i32>)
:
required: falseThe time in seconds after which the session automatically terminates if there is no activity. The default value is 900 seconds (15 minutes). The minimum allowed value is 60 seconds, and the maximum allowed value is 28800 seconds (8 hours).
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.
- On success, responds with
StartCodeInterpreterSessionOutput
with field(s):code_interpreter_identifier(String)
:The identifier of the code interpreter.
session_id(String)
:The unique identifier of the created code interpreter session.
created_at(DateTime)
:The time at which the code interpreter session was created.
- On failure, responds with
SdkError<StartCodeInterpreterSessionError>
Source§impl Client
impl Client
Sourcepub fn stop_browser_session(&self) -> StopBrowserSessionFluentBuilder
pub fn stop_browser_session(&self) -> StopBrowserSessionFluentBuilder
Constructs a fluent builder for the StopBrowserSession
operation.
- The fluent builder is configurable:
trace_id(impl Into<String>)
/set_trace_id(Option<String>)
:
required: falseThe trace identifier for request tracking.
trace_parent(impl Into<String>)
/set_trace_parent(Option<String>)
:
required: falseThe parent trace information for distributed tracing.
browser_identifier(impl Into<String>)
/set_browser_identifier(Option<String>)
:
required: trueThe unique identifier of the browser associated with the session.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe unique identifier of the browser session to stop.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
- On success, responds with
StopBrowserSessionOutput
with field(s):browser_identifier(String)
:The identifier of the browser.
session_id(String)
:The identifier of the browser session.
last_updated_at(DateTime)
:The time at which the browser session was last updated.
- On failure, responds with
SdkError<StopBrowserSessionError>
Source§impl Client
impl Client
Sourcepub fn stop_code_interpreter_session(
&self,
) -> StopCodeInterpreterSessionFluentBuilder
pub fn stop_code_interpreter_session( &self, ) -> StopCodeInterpreterSessionFluentBuilder
Constructs a fluent builder for the StopCodeInterpreterSession
operation.
- The fluent builder is configurable:
trace_id(impl Into<String>)
/set_trace_id(Option<String>)
:
required: falseThe trace identifier for request tracking.
trace_parent(impl Into<String>)
/set_trace_parent(Option<String>)
:
required: falseThe parent trace information for distributed tracing.
code_interpreter_identifier(impl Into<String>)
/set_code_interpreter_identifier(Option<String>)
:
required: trueThe unique identifier of the code interpreter associated with the session.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe unique identifier of the code interpreter session to stop.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
- On success, responds with
StopCodeInterpreterSessionOutput
with field(s):code_interpreter_identifier(String)
:The identifier of the code interpreter.
session_id(String)
:The identifier of the code interpreter session.
last_updated_at(DateTime)
:The timestamp when the code interpreter session was last updated.
- On failure, responds with
SdkError<StopCodeInterpreterSessionError>
Source§impl Client
impl Client
Sourcepub fn stop_runtime_session(&self) -> StopRuntimeSessionFluentBuilder
pub fn stop_runtime_session(&self) -> StopRuntimeSessionFluentBuilder
Constructs a fluent builder for the StopRuntimeSession
operation.
- The fluent builder is configurable:
runtime_session_id(impl Into<String>)
/set_runtime_session_id(Option<String>)
:
required: trueThe ID of the session that you want to stop.
agent_runtime_arn(impl Into<String>)
/set_agent_runtime_arn(Option<String>)
:
required: trueThe ARN of the agent that contains the session that you want to stop.
qualifier(impl Into<String>)
/set_qualifier(Option<String>)
:
required: falseOptional qualifier to specify an agent alias, such as
prod
code> ordev
. If you don’t provide a value, the DEFAULT alias is used.client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseIdempotent token used to identify the request. If you use the same token with multiple requests, the same response is returned. Use ClientToken to prevent the same request from being processed more than once.
- On success, responds with
StopRuntimeSessionOutput
with field(s):runtime_session_id(Option<String>)
:The ID of the session that you requested to stop.
status_code(Option<i32>)
:The status code of the request to stop the session.
- On failure, responds with
SdkError<StopRuntimeSessionError>
Source§impl Client
impl Client
Sourcepub fn update_browser_stream(&self) -> UpdateBrowserStreamFluentBuilder
pub fn update_browser_stream(&self) -> UpdateBrowserStreamFluentBuilder
Constructs a fluent builder for the UpdateBrowserStream
operation.
- The fluent builder is configurable:
browser_identifier(impl Into<String>)
/set_browser_identifier(Option<String>)
:
required: trueThe identifier of the browser.
session_id(impl Into<String>)
/set_session_id(Option<String>)
:
required: trueThe identifier of the browser session.
stream_update(StreamUpdate)
/set_stream_update(Option<StreamUpdate>)
:
required: trueThe update to apply to the browser stream.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
- On success, responds with
UpdateBrowserStreamOutput
with field(s):browser_identifier(String)
:The identifier of the browser.
session_id(String)
:The identifier of the browser session.
streams(Option<BrowserSessionStream>)
:The collection of streams associated with a browser session in Amazon Bedrock. These streams provide different ways to interact with and observe the browser session, including programmatic control and visual representation of the browser content.
updated_at(DateTime)
:The time at which the browser stream was updated.
- On failure, responds with
SdkError<UpdateBrowserStreamError>
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);