Struct aws_sdk_dynamodb::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Client for Amazon DynamoDB

Client for invoking operations on Amazon DynamoDB. Each operation on Amazon DynamoDB 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_dynamodb::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_dynamodb::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 BatchExecuteStatement operation has a Client::batch_execute_statement, 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_execute_statement()
    .return_consumed_capacity("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.

§Waiters

This client provides wait_until methods behind the Waiters trait. To use them, simply import the trait, and then call one of the wait_until methods. This will return a waiter fluent builder that takes various parameters, which are documented on the builder type. Once parameters have been provided, the wait method can be called to initiate waiting.

For example, if there was a wait_until_thing method, it could look like:

let result = client.wait_until_thing()
    .thing_id("someId")
    .wait(Duration::from_secs(120))
    .await;

Implementations§

source§

impl Client

source

pub fn batch_execute_statement(&self) -> BatchExecuteStatementFluentBuilder

Constructs a fluent builder for the BatchExecuteStatement operation.

source§

impl Client

source

pub fn batch_get_item(&self) -> BatchGetItemFluentBuilder

Constructs a fluent builder for the BatchGetItem operation.

  • The fluent builder is configurable:
    • request_items(impl Into<String>, KeysAndAttributes) / set_request_items(Option<HashMap::<String, KeysAndAttributes>>):
      required: true

      A map of one or more table names or table ARNs and, for each table, a map that describes one or more items to retrieve from that table. Each table name or ARN can be used only once per BatchGetItem request.

      Each element in the map of items to retrieve consists of the following:

      • ConsistentRead - If true, a strongly consistent read is used; if false (the default), an eventually consistent read is used.

      • ExpressionAttributeNames - One or more substitution tokens for attribute names in the ProjectionExpression parameter. The following are some use cases for using ExpressionAttributeNames:

        • To access an attribute whose name conflicts with a DynamoDB reserved word.

        • To create a placeholder for repeating occurrences of an attribute name in an expression.

        • To prevent special characters in an attribute name from being misinterpreted in an expression.

        Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

        • Percentile

        The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:

        • {“#P”:“Percentile”}

        You could then use this substitution in an expression, as in this example:

        • #P = :val

        Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

        For more information about expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

      • Keys - An array of primary key attribute values that define specific items in the table. For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide the partition key value. For a composite key, you must provide both the partition key value and the sort key value.

      • ProjectionExpression - A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.

        If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.

        For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

      • AttributesToGet - This is a legacy parameter. Use ProjectionExpression instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


  • On success, responds with BatchGetItemOutput with field(s):
    • responses(Option<HashMap::<String, Vec::<HashMap::<String, AttributeValue>>>>):

      A map of table name or table ARN to a list of items. Each object in Responses consists of a table name or ARN, along with a map of attribute data consisting of the data type and attribute value.

    • unprocessed_keys(Option<HashMap::<String, KeysAndAttributes>>):

      A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

      Each element consists of:

      • Keys - An array of primary key attribute values that define specific items in the table.

      • ProjectionExpression - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

      • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

      If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

    • consumed_capacity(Option<Vec::<ConsumedCapacity>>):

      The read capacity units consumed by the entire BatchGetItem operation.

      Each element consists of:

      • TableName - The table that consumed the provisioned throughput.

      • CapacityUnits - The total number of capacity units consumed.

  • On failure, responds with SdkError<BatchGetItemError>
source§

impl Client

source

pub fn batch_write_item(&self) -> BatchWriteItemFluentBuilder

Constructs a fluent builder for the BatchWriteItem operation.

  • The fluent builder is configurable:
    • request_items(impl Into<String>, Vec::<WriteRequest>) / set_request_items(Option<HashMap::<String, Vec::<WriteRequest>>>):
      required: true

      A map of one or more table names or table ARNs and, for each table, a list of operations to be performed (DeleteRequest or PutRequest). Each element in the map consists of the following:

      • DeleteRequest - Perform a DeleteItem operation on the specified item. The item to be deleted is identified by a Key subelement:

        • Key - A map of primary key attribute values that uniquely identify the item. Each entry in this map consists of an attribute name and an attribute value. For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.

      • PutRequest - Perform a PutItem operation on the specified item. The item to be put is identified by an Item subelement:

        • Item - A map of attributes and their values. Each entry in this map consists of an attribute name and an attribute value. Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that contain empty values are rejected with a ValidationException exception.

          If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table’s attribute definition.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • return_item_collection_metrics(ReturnItemCollectionMetrics) / set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>):
      required: false

      Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to NONE (the default), no statistics are returned.


  • On success, responds with BatchWriteItemOutput with field(s):
    • unprocessed_items(Option<HashMap::<String, Vec::<WriteRequest>>>):

      A map of tables and requests against those tables that were not processed. The UnprocessedItems value is in the same form as RequestItems, so you can provide this value directly to a subsequent BatchWriteItem operation. For more information, see RequestItems in the Request Parameters section.

      Each UnprocessedItems entry consists of a table name or table ARN and, for that table, a list of operations to perform (DeleteRequest or PutRequest).

      • DeleteRequest - Perform a DeleteItem operation on the specified item. The item to be deleted is identified by a Key subelement:

        • Key - A map of primary key attribute values that uniquely identify the item. Each entry in this map consists of an attribute name and an attribute value.

      • PutRequest - Perform a PutItem operation on the specified item. The item to be put is identified by an Item subelement:

        • Item - A map of attributes and their values. Each entry in this map consists of an attribute name and an attribute value. Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that contain empty values will be rejected with a ValidationException exception.

          If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table’s attribute definition.

      If there are no unprocessed items remaining, the response contains an empty UnprocessedItems map.

    • item_collection_metrics(Option<HashMap::<String, Vec::<ItemCollectionMetrics>>>):

      A list of tables that were processed by BatchWriteItem and, for each table, information about any item collections that were affected by individual DeleteItem or PutItem operations.

      Each entry consists of the following subelements:

      • ItemCollectionKey - The partition key value of the item collection. This is the same as the partition key value of the item.

      • SizeEstimateRangeGB - An estimate of item collection size, expressed in GB. This is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on the table. Use this estimate to measure whether a local secondary index is approaching its size limit.

        The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

    • consumed_capacity(Option<Vec::<ConsumedCapacity>>):

      The capacity units consumed by the entire BatchWriteItem operation.

      Each element consists of:

      • TableName - The table that consumed the provisioned throughput.

      • CapacityUnits - The total number of capacity units consumed.

  • On failure, responds with SdkError<BatchWriteItemError>
source§

impl Client

source

pub fn create_backup(&self) -> CreateBackupFluentBuilder

Constructs a fluent builder for the CreateBackup operation.

source§

impl Client

source

pub fn create_global_table(&self) -> CreateGlobalTableFluentBuilder

Constructs a fluent builder for the CreateGlobalTable operation.

source§

impl Client

source

pub fn create_table(&self) -> CreateTableFluentBuilder

Constructs a fluent builder for the CreateTable operation.

  • The fluent builder is configurable:
    • attribute_definitions(AttributeDefinition) / set_attribute_definitions(Option<Vec::<AttributeDefinition>>):
      required: true

      An array of attributes that describe the key schema for the table and indexes.


    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • key_schema(KeySchemaElement) / set_key_schema(Option<Vec::<KeySchemaElement>>):
      required: true

      Specifies the attributes that make up the primary key for a table or an index. The attributes in KeySchema must also be defined in the AttributeDefinitions array. For more information, see Data Model in the Amazon DynamoDB Developer Guide.

      Each KeySchemaElement in the array is composed of:

      • AttributeName - The name of this key attribute.

      • KeyType - The role that the key attribute will assume:

        • HASH - partition key

        • RANGE - sort key

      The partition key of an item is also known as its hash attribute. The term “hash attribute” derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.

      The sort key of an item is also known as its range attribute. The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

      For a simple primary key (partition key), you must provide exactly one element with a KeyType of HASH.

      For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a KeyType of HASH, and the second element must have a KeyType of RANGE.

      For more information, see Working with Tables in the Amazon DynamoDB Developer Guide.


    • local_secondary_indexes(LocalSecondaryIndex) / set_local_secondary_indexes(Option<Vec::<LocalSecondaryIndex>>):
      required: false

      One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.

      Each local secondary index in the array includes the following:

      • IndexName - The name of the local secondary index. Must be unique only for this table.

      • KeySchema - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.

      • Projection - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:

        • ProjectionType - One of the following:

          • KEYS_ONLY - Only the index and primary keys are projected into the index.

          • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes is in NonKeyAttributes.

          • ALL - All of the table attributes are projected into the index.

        • NonKeyAttributes - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in NonKeyAttributes, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.


    • global_secondary_indexes(GlobalSecondaryIndex) / set_global_secondary_indexes(Option<Vec::<GlobalSecondaryIndex>>):
      required: false

      One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:

      • IndexName - The name of the global secondary index. Must be unique only for this table.

      • KeySchema - Specifies the key schema for the global secondary index.

      • Projection - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:

        • ProjectionType - One of the following:

          • KEYS_ONLY - Only the index and primary keys are projected into the index.

          • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes is in NonKeyAttributes.

          • ALL - All of the table attributes are projected into the index.

        • NonKeyAttributes - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in NonKeyAttributes, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

      • ProvisionedThroughput - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.


    • billing_mode(BillingMode) / set_billing_mode(Option<BillingMode>):
      required: false

      Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.

      • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned capacity mode.

      • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-demand capacity mode.


    • provisioned_throughput(ProvisionedThroughput) / set_provisioned_throughput(Option<ProvisionedThroughput>):
      required: false

      Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable operation.

      If you set BillingMode as PROVISIONED, you must specify this property. If you set BillingMode as PAY_PER_REQUEST, you cannot specify this property.

      For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.


    • stream_specification(StreamSpecification) / set_stream_specification(Option<StreamSpecification>):
      required: false

      The settings for DynamoDB Streams on the table. These settings consist of:

      • StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).

      • StreamViewType - When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values for StreamViewType are:

        • KEYS_ONLY - Only the key attributes of the modified item are written to the stream.

        • NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream.

        • OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream.

        • NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream.


    • sse_specification(SseSpecification) / set_sse_specification(Option<SseSpecification>):
      required: false

      Represents the settings used to enable server-side encryption.


    • tags(Tag) / set_tags(Option<Vec::<Tag>>):
      required: false

      A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.


    • table_class(TableClass) / set_table_class(Option<TableClass>):
      required: false

      The table class of the new table. Valid values are STANDARD and STANDARD_INFREQUENT_ACCESS.


    • deletion_protection_enabled(bool) / set_deletion_protection_enabled(Option<bool>):
      required: false

      Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.


    • resource_policy(impl Into<String>) / set_resource_policy(Option<String>):
      required: false

      An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.

      When you attach a resource-based policy while creating a table, the policy application is strongly consistent.

      The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see Resource-based policy considerations.

      You need to specify the CreateTable and PutResourcePolicy IAM actions for authorizing a user to create a table with a resource-based policy.


    • on_demand_throughput(OnDemandThroughput) / set_on_demand_throughput(Option<OnDemandThroughput>):
      required: false

      Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify MaxReadRequestUnits, MaxWriteRequestUnits, or both.


  • On success, responds with CreateTableOutput with field(s):
  • On failure, responds with SdkError<CreateTableError>
source§

impl Client

source

pub fn delete_backup(&self) -> DeleteBackupFluentBuilder

Constructs a fluent builder for the DeleteBackup operation.

source§

impl Client

source

pub fn delete_item(&self) -> DeleteItemFluentBuilder

Constructs a fluent builder for the DeleteItem operation.

  • The fluent builder is configurable:
    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table from which to delete the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • key(impl Into<String>, AttributeValue) / set_key(Option<HashMap::<String, AttributeValue>>):
      required: true

      A map of attribute names to AttributeValue objects, representing the primary key of the item to delete.

      For the primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.


    • expected(impl Into<String>, ExpectedAttributeValue) / set_expected(Option<HashMap::<String, ExpectedAttributeValue>>):
      required: false

      This is a legacy parameter. Use ConditionExpression instead. For more information, see Expected in the Amazon DynamoDB Developer Guide.


    • conditional_operator(ConditionalOperator) / set_conditional_operator(Option<ConditionalOperator>):
      required: false

      This is a legacy parameter. Use ConditionExpression instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.


    • return_values(ReturnValue) / set_return_values(Option<ReturnValue>):
      required: false

      Use ReturnValues if you want to get the item attributes as they appeared before they were deleted. For DeleteItem, the valid values are:

      • NONE - If ReturnValues is not specified, or if its value is NONE, then nothing is returned. (This setting is the default for ReturnValues.)

      • ALL_OLD - The content of the old item is returned.

      There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.

      The ReturnValues parameter is used by several DynamoDB operations; however, DeleteItem does not recognize any values other than NONE or ALL_OLD.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • return_item_collection_metrics(ReturnItemCollectionMetrics) / set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>):
      required: false

      Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to NONE (the default), no statistics are returned.


    • condition_expression(impl Into<String>) / set_condition_expression(Option<String>):
      required: false

      A condition that must be satisfied in order for a conditional DeleteItem to succeed.

      An expression can contain any of the following:

      • Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size

        These function names are case-sensitive.

      • Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN

      • Logical operators: AND | OR | NOT

      For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide.


    • expression_attribute_names(impl Into<String>, impl Into<String>) / set_expression_attribute_names(Option<HashMap::<String, String>>):
      required: false

      One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

      • To access an attribute whose name conflicts with a DynamoDB reserved word.

      • To create a placeholder for repeating occurrences of an attribute name in an expression.

      • To prevent special characters in an attribute name from being misinterpreted in an expression.

      Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

      • Percentile

      The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:

      • {“#P”:“Percentile”}

      You could then use this substitution in an expression, as in this example:

      • #P = :val

      Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

      For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • expression_attribute_values(impl Into<String>, AttributeValue) / set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>):
      required: false

      One or more values that can be substituted in an expression.

      Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

      Available | Backordered | Discontinued

      You would first need to specify ExpressionAttributeValues as follows:

      { “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }

      You could then use these values in an expression, such as this:

      ProductStatus IN (:avail, :back, :disc)

      For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.


    • return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure) / set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>):
      required: false

      An optional parameter that returns the item attributes for a DeleteItem operation that failed a condition check.

      There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.


  • On success, responds with DeleteItemOutput with field(s):
    • attributes(Option<HashMap::<String, AttributeValue>>):

      A map of attribute names to AttributeValue objects, representing the item as it appeared before the DeleteItem operation. This map appears in the response only if ReturnValues was specified as ALL_OLD in the request.

    • consumed_capacity(Option<ConsumedCapacity>):

      The capacity units consumed by the DeleteItem operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified. For more information, see Provisioned capacity mode in the Amazon DynamoDB Developer Guide.

    • item_collection_metrics(Option<ItemCollectionMetrics>):

      Information about item collections, if any, that were affected by the DeleteItem operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.

      Each ItemCollectionMetrics element consists of:

      • ItemCollectionKey - The partition key value of the item collection. This is the same as the partition key value of the item itself.

      • SizeEstimateRangeGB - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.

        The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

  • On failure, responds with SdkError<DeleteItemError>
source§

impl Client

source

pub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder

Constructs a fluent builder for the DeleteResourcePolicy operation.

  • The fluent builder is configurable:
    • resource_arn(impl Into<String>) / set_resource_arn(Option<String>):
      required: true

      The Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table’s indexes defined in that policy document. This is because index permissions are defined in the table’s policy.


    • expected_revision_id(impl Into<String>) / set_expected_revision_id(Option<String>):
      required: false

      A string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn’t match or if there’s no policy attached to the resource, the request will fail and return a PolicyNotFoundException.


  • On success, responds with DeleteResourcePolicyOutput with field(s):
    • revision_id(Option<String>):

      A unique string that represents the revision ID of the policy. If you’re comparing revision IDs, make sure to always use string comparison logic.

      This value will be empty if you make a request against a resource without a policy.

  • On failure, responds with SdkError<DeleteResourcePolicyError>
source§

impl Client

source

pub fn delete_table(&self) -> DeleteTableFluentBuilder

Constructs a fluent builder for the DeleteTable operation.

source§

impl Client

source

pub fn describe_backup(&self) -> DescribeBackupFluentBuilder

Constructs a fluent builder for the DescribeBackup operation.

source§

impl Client

source

pub fn describe_continuous_backups( &self, ) -> DescribeContinuousBackupsFluentBuilder

Constructs a fluent builder for the DescribeContinuousBackups operation.

source§

impl Client

source

pub fn describe_contributor_insights( &self, ) -> DescribeContributorInsightsFluentBuilder

Constructs a fluent builder for the DescribeContributorInsights operation.

source§

impl Client

source

pub fn describe_endpoints(&self) -> DescribeEndpointsFluentBuilder

Constructs a fluent builder for the DescribeEndpoints operation.

source§

impl Client

source

pub fn describe_export(&self) -> DescribeExportFluentBuilder

Constructs a fluent builder for the DescribeExport operation.

source§

impl Client

source

pub fn describe_global_table(&self) -> DescribeGlobalTableFluentBuilder

Constructs a fluent builder for the DescribeGlobalTable operation.

source§

impl Client

source

pub fn describe_global_table_settings( &self, ) -> DescribeGlobalTableSettingsFluentBuilder

Constructs a fluent builder for the DescribeGlobalTableSettings operation.

source§

impl Client

source

pub fn describe_import(&self) -> DescribeImportFluentBuilder

Constructs a fluent builder for the DescribeImport operation.

source§

impl Client

source

pub fn describe_kinesis_streaming_destination( &self, ) -> DescribeKinesisStreamingDestinationFluentBuilder

Constructs a fluent builder for the DescribeKinesisStreamingDestination operation.

source§

impl Client

source

pub fn describe_limits(&self) -> DescribeLimitsFluentBuilder

Constructs a fluent builder for the DescribeLimits operation.

source§

impl Client

source

pub fn describe_table(&self) -> DescribeTableFluentBuilder

Constructs a fluent builder for the DescribeTable operation.

source§

impl Client

source

pub fn describe_table_replica_auto_scaling( &self, ) -> DescribeTableReplicaAutoScalingFluentBuilder

Constructs a fluent builder for the DescribeTableReplicaAutoScaling operation.

source§

impl Client

source

pub fn describe_time_to_live(&self) -> DescribeTimeToLiveFluentBuilder

Constructs a fluent builder for the DescribeTimeToLive operation.

source§

impl Client

source

pub fn disable_kinesis_streaming_destination( &self, ) -> DisableKinesisStreamingDestinationFluentBuilder

Constructs a fluent builder for the DisableKinesisStreamingDestination operation.

source§

impl Client

source

pub fn enable_kinesis_streaming_destination( &self, ) -> EnableKinesisStreamingDestinationFluentBuilder

Constructs a fluent builder for the EnableKinesisStreamingDestination operation.

source§

impl Client

source

pub fn execute_statement(&self) -> ExecuteStatementFluentBuilder

Constructs a fluent builder for the ExecuteStatement operation.

  • The fluent builder is configurable:
  • On success, responds with ExecuteStatementOutput with field(s):
    • items(Option<Vec::<HashMap::<String, AttributeValue>>>):

      If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.

    • next_token(Option<String>):

      If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.

    • consumed_capacity(Option<ConsumedCapacity>):

      The capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the request asked for it. For more information, see Provisioned capacity mode in the Amazon DynamoDB Developer Guide.

    • last_evaluated_key(Option<HashMap::<String, AttributeValue>>):

      The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedKey is empty, then the “last page” of results has been processed and there is no more data to be retrieved. If LastEvaluatedKey is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey is empty.

  • On failure, responds with SdkError<ExecuteStatementError>
source§

impl Client

source

pub fn execute_transaction(&self) -> ExecuteTransactionFluentBuilder

Constructs a fluent builder for the ExecuteTransaction operation.

source§

impl Client

source

pub fn export_table_to_point_in_time( &self, ) -> ExportTableToPointInTimeFluentBuilder

Constructs a fluent builder for the ExportTableToPointInTime operation.

source§

impl Client

source

pub fn get_item(&self) -> GetItemFluentBuilder

Constructs a fluent builder for the GetItem operation.

  • The fluent builder is configurable:
    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table containing the requested item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • key(impl Into<String>, AttributeValue) / set_key(Option<HashMap::<String, AttributeValue>>):
      required: true

      A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve.

      For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.


    • attributes_to_get(impl Into<String>) / set_attributes_to_get(Option<Vec::<String>>):
      required: false

      This is a legacy parameter. Use ProjectionExpression instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.


    • consistent_read(bool) / set_consistent_read(Option<bool>):
      required: false

      Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • projection_expression(impl Into<String>) / set_projection_expression(Option<String>):
      required: false

      A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.

      If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.

      For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • expression_attribute_names(impl Into<String>, impl Into<String>) / set_expression_attribute_names(Option<HashMap::<String, String>>):
      required: false

      One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

      • To access an attribute whose name conflicts with a DynamoDB reserved word.

      • To create a placeholder for repeating occurrences of an attribute name in an expression.

      • To prevent special characters in an attribute name from being misinterpreted in an expression.

      Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

      • Percentile

      The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:

      • {“#P”:“Percentile”}

      You could then use this substitution in an expression, as in this example:

      • #P = :val

      Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

      For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


  • On success, responds with GetItemOutput with field(s):
  • On failure, responds with SdkError<GetItemError>
source§

impl Client

source

pub fn get_resource_policy(&self) -> GetResourcePolicyFluentBuilder

Constructs a fluent builder for the GetResourcePolicy operation.

source§

impl Client

source

pub fn import_table(&self) -> ImportTableFluentBuilder

Constructs a fluent builder for the ImportTable operation.

source§

impl Client

source

pub fn list_backups(&self) -> ListBackupsFluentBuilder

Constructs a fluent builder for the ListBackups operation.

source§

impl Client

source

pub fn list_contributor_insights(&self) -> ListContributorInsightsFluentBuilder

Constructs a fluent builder for the ListContributorInsights operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_exports(&self) -> ListExportsFluentBuilder

Constructs a fluent builder for the ListExports operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_global_tables(&self) -> ListGlobalTablesFluentBuilder

Constructs a fluent builder for the ListGlobalTables operation.

source§

impl Client

source

pub fn list_imports(&self) -> ListImportsFluentBuilder

Constructs a fluent builder for the ListImports operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_tables(&self) -> ListTablesFluentBuilder

Constructs a fluent builder for the ListTables operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
  • On success, responds with ListTablesOutput with field(s):
    • table_names(Option<Vec::<String>>):

      The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.

      If LastEvaluatedTableName also appears in the output, you can use this value as the ExclusiveStartTableName parameter in a subsequent ListTables request and obtain the next page of results.

    • last_evaluated_table_name(Option<String>):

      The name of the last table in the current page of results. Use this value as the ExclusiveStartTableName in a new request to obtain the next page of results, until all the table names are returned.

      If you do not receive a LastEvaluatedTableName value in the response, this means that there are no more table names to be retrieved.

  • On failure, responds with SdkError<ListTablesError>
source§

impl Client

source

pub fn list_tags_of_resource(&self) -> ListTagsOfResourceFluentBuilder

Constructs a fluent builder for the ListTagsOfResource operation.

source§

impl Client

source

pub fn put_item(&self) -> PutItemFluentBuilder

Constructs a fluent builder for the PutItem operation.

  • The fluent builder is configurable:
    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table to contain the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • item(impl Into<String>, AttributeValue) / set_item(Option<HashMap::<String, AttributeValue>>):
      required: true

      A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.

      You must provide all of the attributes for the primary key. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide both values for both the partition key and the sort key.

      If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table’s attribute definition.

      Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.

      For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.

      Each element in the Item map is an AttributeValue object.


    • expected(impl Into<String>, ExpectedAttributeValue) / set_expected(Option<HashMap::<String, ExpectedAttributeValue>>):
      required: false

      This is a legacy parameter. Use ConditionExpression instead. For more information, see Expected in the Amazon DynamoDB Developer Guide.


    • return_values(ReturnValue) / set_return_values(Option<ReturnValue>):
      required: false

      Use ReturnValues if you want to get the item attributes as they appeared before they were updated with the PutItem request. For PutItem, the valid values are:

      • NONE - If ReturnValues is not specified, or if its value is NONE, then nothing is returned. (This setting is the default for ReturnValues.)

      • ALL_OLD - If PutItem overwrote an attribute name-value pair, then the content of the old item is returned.

      The values returned are strongly consistent.

      There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.

      The ReturnValues parameter is used by several DynamoDB operations; however, PutItem does not recognize any values other than NONE or ALL_OLD.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • return_item_collection_metrics(ReturnItemCollectionMetrics) / set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>):
      required: false

      Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to NONE (the default), no statistics are returned.


    • conditional_operator(ConditionalOperator) / set_conditional_operator(Option<ConditionalOperator>):
      required: false

      This is a legacy parameter. Use ConditionExpression instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.


    • condition_expression(impl Into<String>) / set_condition_expression(Option<String>):
      required: false

      A condition that must be satisfied in order for a conditional PutItem operation to succeed.

      An expression can contain any of the following:

      • Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size

        These function names are case-sensitive.

      • Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN

      • Logical operators: AND | OR | NOT

      For more information on condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide.


    • expression_attribute_names(impl Into<String>, impl Into<String>) / set_expression_attribute_names(Option<HashMap::<String, String>>):
      required: false

      One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

      • To access an attribute whose name conflicts with a DynamoDB reserved word.

      • To create a placeholder for repeating occurrences of an attribute name in an expression.

      • To prevent special characters in an attribute name from being misinterpreted in an expression.

      Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

      • Percentile

      The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:

      • {“#P”:“Percentile”}

      You could then use this substitution in an expression, as in this example:

      • #P = :val

      Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

      For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • expression_attribute_values(impl Into<String>, AttributeValue) / set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>):
      required: false

      One or more values that can be substituted in an expression.

      Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

      Available | Backordered | Discontinued

      You would first need to specify ExpressionAttributeValues as follows:

      { “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }

      You could then use these values in an expression, such as this:

      ProductStatus IN (:avail, :back, :disc)

      For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.


    • return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure) / set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>):
      required: false

      An optional parameter that returns the item attributes for a PutItem operation that failed a condition check.

      There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.


  • On success, responds with PutItemOutput with field(s):
    • attributes(Option<HashMap::<String, AttributeValue>>):

      The attribute values as they appeared before the PutItem operation, but only if ReturnValues is specified as ALL_OLD in the request. Each element consists of an attribute name and an attribute value.

    • consumed_capacity(Option<ConsumedCapacity>):

      The capacity units consumed by the PutItem operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified. For more information, see Capacity unity consumption for write operations in the Amazon DynamoDB Developer Guide.

    • item_collection_metrics(Option<ItemCollectionMetrics>):

      Information about item collections, if any, that were affected by the PutItem operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.

      Each ItemCollectionMetrics element consists of:

      • ItemCollectionKey - The partition key value of the item collection. This is the same as the partition key value of the item itself.

      • SizeEstimateRangeGB - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.

        The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

  • On failure, responds with SdkError<PutItemError>
source§

impl Client

source

pub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder

Constructs a fluent builder for the PutResourcePolicy operation.

  • The fluent builder is configurable:
    • resource_arn(impl Into<String>) / set_resource_arn(Option<String>):
      required: true

      The Amazon Resource Name (ARN) of the DynamoDB resource to which the policy will be attached. The resources you can specify include tables and streams.

      You can control index permissions using the base table’s policy. To specify the same permission level for your table and its indexes, you can provide both the table and index Amazon Resource Name (ARN)s in the Resource field of a given Statement in your policy document. Alternatively, to specify different permissions for your table, indexes, or both, you can define multiple Statement fields in your policy document.


    • policy(impl Into<String>) / set_policy(Option<String>):
      required: true

      An Amazon Web Services resource-based policy document in JSON format.

      • The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit.

      • Within a resource-based policy, if the action for a DynamoDB service-linked role (SLR) to replicate data for a global table is denied, adding or deleting a replica will fail with an error.

      For a full list of all considerations that apply while attaching a resource-based policy, see Resource-based policy considerations.


    • expected_revision_id(impl Into<String>) / set_expected_revision_id(Option<String>):
      required: false

      A string value that you can use to conditionally update your policy. You can provide the revision ID of your existing policy to make mutating requests against that policy.

      When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn’t match or if there’s no policy attached to the resource, your request will be rejected with a PolicyNotFoundException.

      To conditionally attach a policy when no policy exists for the resource, specify NO_POLICY for the revision ID.


    • confirm_remove_self_resource_access(bool) / set_confirm_remove_self_resource_access(Option<bool>):
      required: false

      Set this parameter to true to confirm that you want to remove your permissions to change the policy of this resource in the future.


  • On success, responds with PutResourcePolicyOutput with field(s):
    • revision_id(Option<String>):

      A unique string that represents the revision ID of the policy. If you’re comparing revision IDs, make sure to always use string comparison logic.

  • On failure, responds with SdkError<PutResourcePolicyError>
source§

impl Client

source

pub fn query(&self) -> QueryFluentBuilder

Constructs a fluent builder for the Query operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • index_name(impl Into<String>) / set_index_name(Option<String>):
      required: false

      The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the IndexName parameter, you must also provide TableName.


    • select(Select) / set_select(Option<Select>):
      required: false

      The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.

      • ALL_ATTRIBUTES - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.

      • ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying ALL_ATTRIBUTES.

      • COUNT - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.

      • SPECIFIC_ATTRIBUTES - Returns only the attributes listed in ProjectionExpression. This return value is equivalent to specifying ProjectionExpression without specifying any value for Select.

        If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.

        If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.

      If neither Select nor ProjectionExpression are specified, DynamoDB defaults to ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when accessing an index. You cannot use both Select and ProjectionExpression together in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying ProjectionExpression without any value for Select.)

      If you use the ProjectionExpression parameter, then the value for Select can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an error.


    • attributes_to_get(impl Into<String>) / set_attributes_to_get(Option<Vec::<String>>):
      required: false

      This is a legacy parameter. Use ProjectionExpression instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.


    • limit(i32) / set_limit(Option<i32>):
      required: false

      The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey to apply in a subsequent operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer Guide.


    • consistent_read(bool) / set_consistent_read(Option<bool>):
      required: false

      Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.

      Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with ConsistentRead set to true, you will receive a ValidationException.


    • key_conditions(impl Into<String>, Condition) / set_key_conditions(Option<HashMap::<String, Condition>>):
      required: false

      This is a legacy parameter. Use KeyConditionExpression instead. For more information, see KeyConditions in the Amazon DynamoDB Developer Guide.


    • query_filter(impl Into<String>, Condition) / set_query_filter(Option<HashMap::<String, Condition>>):
      required: false

      This is a legacy parameter. Use FilterExpression instead. For more information, see QueryFilter in the Amazon DynamoDB Developer Guide.


    • conditional_operator(ConditionalOperator) / set_conditional_operator(Option<ConditionalOperator>):
      required: false

      This is a legacy parameter. Use FilterExpression instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.


    • scan_index_forward(bool) / set_scan_index_forward(Option<bool>):
      required: false

      Specifies the order for index traversal: If true (default), the traversal is performed in ascending order; if false, the traversal is performed in descending order.

      Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.

      If ScanIndexForward is true, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If ScanIndexForward is false, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.


    • exclusive_start_key(impl Into<String>, AttributeValue) / set_exclusive_start_key(Option<HashMap::<String, AttributeValue>>):
      required: false

      The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey in the previous operation.

      The data type for ExclusiveStartKey must be String, Number, or Binary. No set data types are allowed.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • projection_expression(impl Into<String>) / set_projection_expression(Option<String>):
      required: false

      A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.

      If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.

      For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.


    • filter_expression(impl Into<String>) / set_filter_expression(Option<String>):
      required: false

      A string that contains conditions that DynamoDB applies after the Query operation, but before the data is returned to you. Items that do not satisfy the FilterExpression criteria are not returned.

      A FilterExpression does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.

      A FilterExpression is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.

      For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.


    • key_condition_expression(impl Into<String>) / set_key_condition_expression(Option<String>):
      required: false

      The condition that specifies the key values for items to be retrieved by the Query action.

      The condition must perform an equality test on a single partition key value.

      The condition can optionally perform one of several comparison tests on a single sort key value. This allows Query to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.

      The partition key equality test is required, and must be specified in the following format:

      partitionKeyName = :partitionkeyval

      If you also want to provide a condition for the sort key, it must be combined using AND with the condition for the sort key. Following is an example, using the = comparison operator for the sort key:

      partitionKeyName = :partitionkeyval AND sortKeyName = :sortkeyval

      Valid comparisons for the sort key condition are as follows:

      • sortKeyName = :sortkeyval - true if the sort key value is equal to :sortkeyval.

      • sortKeyName < :sortkeyval - true if the sort key value is less than :sortkeyval.

      • sortKeyName <= :sortkeyval - true if the sort key value is less than or equal to :sortkeyval.

      • sortKeyName > :sortkeyval - true if the sort key value is greater than :sortkeyval.

      • sortKeyName >= :sortkeyval - true if the sort key value is greater than or equal to :sortkeyval.

      • sortKeyName BETWEEN :sortkeyval1 AND :sortkeyval2 - true if the sort key value is greater than or equal to :sortkeyval1, and less than or equal to :sortkeyval2.

      • begins_with ( sortKeyName, :sortkeyval ) - true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name begins_with is case-sensitive.

      Use the ExpressionAttributeValues parameter to replace tokens such as :partitionval and :sortval with actual values at runtime.

      You can optionally use the ExpressionAttributeNames parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression parameter causes an error because Size is a reserved word:

      • Size = :myval

      To work around this, define a placeholder (such a #S) to represent the attribute name Size. KeyConditionExpression then is as follows:

      • #S = :myval

      For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.

      For more information on ExpressionAttributeNames and ExpressionAttributeValues, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.


    • expression_attribute_names(impl Into<String>, impl Into<String>) / set_expression_attribute_names(Option<HashMap::<String, String>>):
      required: false

      One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

      • To access an attribute whose name conflicts with a DynamoDB reserved word.

      • To create a placeholder for repeating occurrences of an attribute name in an expression.

      • To prevent special characters in an attribute name from being misinterpreted in an expression.

      Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

      • Percentile

      The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:

      • {“#P”:“Percentile”}

      You could then use this substitution in an expression, as in this example:

      • #P = :val

      Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

      For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • expression_attribute_values(impl Into<String>, AttributeValue) / set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>):
      required: false

      One or more values that can be substituted in an expression.

      Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

      Available | Backordered | Discontinued

      You would first need to specify ExpressionAttributeValues as follows:

      { “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }

      You could then use these values in an expression, such as this:

      ProductStatus IN (:avail, :back, :disc)

      For more information on expression attribute values, see Specifying Conditions in the Amazon DynamoDB Developer Guide.


  • On success, responds with QueryOutput with field(s):
    • items(Option<Vec::<HashMap::<String, AttributeValue>>>):

      An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.

    • count(i32):

      The number of items in the response.

      If you used a QueryFilter in the request, then Count is the number of items returned after the filter was applied, and ScannedCount is the number of matching items before the filter was applied.

      If you did not use a filter in the request, then Count and ScannedCount are the same.

    • scanned_count(i32):

      The number of items evaluated, before any QueryFilter is applied. A high ScannedCount value with few, or no, Count results indicates an inefficient Query operation. For more information, see Count and ScannedCount in the Amazon DynamoDB Developer Guide.

      If you did not use a filter in the request, then ScannedCount is the same as Count.

    • last_evaluated_key(Option<HashMap::<String, AttributeValue>>):

      The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.

      If LastEvaluatedKey is empty, then the “last page” of results has been processed and there is no more data to be retrieved.

      If LastEvaluatedKey is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey is empty.

    • consumed_capacity(Option<ConsumedCapacity>):

      The capacity units consumed by the Query operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.

  • On failure, responds with SdkError<QueryError>
source§

impl Client

source

pub fn restore_table_from_backup(&self) -> RestoreTableFromBackupFluentBuilder

Constructs a fluent builder for the RestoreTableFromBackup operation.

source§

impl Client

source

pub fn restore_table_to_point_in_time( &self, ) -> RestoreTableToPointInTimeFluentBuilder

Constructs a fluent builder for the RestoreTableToPointInTime operation.

source§

impl Client

source

pub fn scan(&self) -> ScanFluentBuilder

Constructs a fluent builder for the Scan operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table containing the requested items or if you provide IndexName, the name of the table to which that index belongs.

      You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • index_name(impl Into<String>) / set_index_name(Option<String>):
      required: false

      The name of a secondary index to scan. This index can be any local secondary index or global secondary index. Note that if you use the IndexName parameter, you must also provide TableName.


    • attributes_to_get(impl Into<String>) / set_attributes_to_get(Option<Vec::<String>>):
      required: false

      This is a legacy parameter. Use ProjectionExpression instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.


    • limit(i32) / set_limit(Option<i32>):
      required: false

      The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey to apply in a subsequent operation to continue the operation. For more information, see Working with Queries in the Amazon DynamoDB Developer Guide.


    • select(Select) / set_select(Option<Select>):
      required: false

      The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.

      • ALL_ATTRIBUTES - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.

      • ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying ALL_ATTRIBUTES.

      • COUNT - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.

      • SPECIFIC_ATTRIBUTES - Returns only the attributes listed in ProjectionExpression. This return value is equivalent to specifying ProjectionExpression without specifying any value for Select.

        If you query or scan a local secondary index and request only attributes that are projected into that index, the operation reads only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.

        If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.

      If neither Select nor ProjectionExpression are specified, DynamoDB defaults to ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when accessing an index. You cannot use both Select and ProjectionExpression together in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying ProjectionExpression without any value for Select.)

      If you use the ProjectionExpression parameter, then the value for Select can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an error.


    • scan_filter(impl Into<String>, Condition) / set_scan_filter(Option<HashMap::<String, Condition>>):
      required: false

      This is a legacy parameter. Use FilterExpression instead. For more information, see ScanFilter in the Amazon DynamoDB Developer Guide.


    • conditional_operator(ConditionalOperator) / set_conditional_operator(Option<ConditionalOperator>):
      required: false

      This is a legacy parameter. Use FilterExpression instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.


    • exclusive_start_key(impl Into<String>, AttributeValue) / set_exclusive_start_key(Option<HashMap::<String, AttributeValue>>):
      required: false

      The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey in the previous operation.

      The data type for ExclusiveStartKey must be String, Number or Binary. No set data types are allowed.

      In a parallel scan, a Scan request that includes ExclusiveStartKey must specify the same segment whose previous Scan returned the corresponding value of LastEvaluatedKey.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • total_segments(i32) / set_total_segments(Option<i32>):
      required: false

      For a parallel Scan request, TotalSegments represents the total number of segments into which the Scan operation will be divided. The value of TotalSegments corresponds to the number of application workers that will perform the parallel scan. For example, if you want to use four application threads to scan a table or an index, specify a TotalSegments value of 4.

      The value for TotalSegments must be greater than or equal to 1, and less than or equal to 1000000. If you specify a TotalSegments value of 1, the Scan operation will be sequential rather than parallel.

      If you specify TotalSegments, you must also specify Segment.


    • segment(i32) / set_segment(Option<i32>):
      required: false

      For a parallel Scan request, Segment identifies an individual segment to be scanned by an application worker.

      Segment IDs are zero-based, so the first segment is always 0. For example, if you want to use four application threads to scan a table or an index, then the first thread specifies a Segment value of 0, the second thread specifies 1, and so on.

      The value of LastEvaluatedKey returned from a parallel Scan request must be used as ExclusiveStartKey with the same segment ID in a subsequent Scan operation.

      The value for Segment must be greater than or equal to 0, and less than the value provided for TotalSegments.

      If you provide Segment, you must also provide TotalSegments.


    • projection_expression(impl Into<String>) / set_projection_expression(Option<String>):
      required: false

      A string that identifies one or more attributes to retrieve from the specified table or index. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.

      If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.

      For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • filter_expression(impl Into<String>) / set_filter_expression(Option<String>):
      required: false

      A string that contains conditions that DynamoDB applies after the Scan operation, but before the data is returned to you. Items that do not satisfy the FilterExpression criteria are not returned.

      A FilterExpression is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.

      For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide.


    • expression_attribute_names(impl Into<String>, impl Into<String>) / set_expression_attribute_names(Option<HashMap::<String, String>>):
      required: false

      One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

      • To access an attribute whose name conflicts with a DynamoDB reserved word.

      • To create a placeholder for repeating occurrences of an attribute name in an expression.

      • To prevent special characters in an attribute name from being misinterpreted in an expression.

      Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

      • Percentile

      The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:

      • {“#P”:“Percentile”}

      You could then use this substitution in an expression, as in this example:

      • #P = :val

      Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

      For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • expression_attribute_values(impl Into<String>, AttributeValue) / set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>):
      required: false

      One or more values that can be substituted in an expression.

      Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

      Available | Backordered | Discontinued

      You would first need to specify ExpressionAttributeValues as follows:

      { “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }

      You could then use these values in an expression, such as this:

      ProductStatus IN (:avail, :back, :disc)

      For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.


    • consistent_read(bool) / set_consistent_read(Option<bool>):
      required: false

      A Boolean value that determines the read consistency model during the scan:

      • If ConsistentRead is false, then the data returned from Scan might not contain the results from other recently completed write operations (PutItem, UpdateItem, or DeleteItem).

      • If ConsistentRead is true, then all of the write operations that completed before the Scan began are guaranteed to be contained in the Scan response.

      The default setting for ConsistentRead is false.

      The ConsistentRead parameter is not supported on global secondary indexes. If you scan a global secondary index with ConsistentRead set to true, you will receive a ValidationException.


  • On success, responds with ScanOutput with field(s):
    • items(Option<Vec::<HashMap::<String, AttributeValue>>>):

      An array of item attributes that match the scan criteria. Each element in this array consists of an attribute name and the value for that attribute.

    • count(i32):

      The number of items in the response.

      If you set ScanFilter in the request, then Count is the number of items returned after the filter was applied, and ScannedCount is the number of matching items before the filter was applied.

      If you did not use a filter in the request, then Count is the same as ScannedCount.

    • scanned_count(i32):

      The number of items evaluated, before any ScanFilter is applied. A high ScannedCount value with few, or no, Count results indicates an inefficient Scan operation. For more information, see Count and ScannedCount in the Amazon DynamoDB Developer Guide.

      If you did not use a filter in the request, then ScannedCount is the same as Count.

    • last_evaluated_key(Option<HashMap::<String, AttributeValue>>):

      The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.

      If LastEvaluatedKey is empty, then the “last page” of results has been processed and there is no more data to be retrieved.

      If LastEvaluatedKey is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey is empty.

    • consumed_capacity(Option<ConsumedCapacity>):

      The capacity units consumed by the Scan operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.

  • On failure, responds with SdkError<ScanError>
source§

impl Client

source

pub fn tag_resource(&self) -> TagResourceFluentBuilder

Constructs a fluent builder for the TagResource operation.

source§

impl Client

source

pub fn transact_get_items(&self) -> TransactGetItemsFluentBuilder

Constructs a fluent builder for the TransactGetItems operation.

source§

impl Client

source

pub fn transact_write_items(&self) -> TransactWriteItemsFluentBuilder

Constructs a fluent builder for the TransactWriteItems operation.

  • The fluent builder is configurable:
    • transact_items(TransactWriteItem) / set_transact_items(Option<Vec::<TransactWriteItem>>):
      required: true

      An ordered array of up to 100 TransactWriteItem objects, each of which contains a ConditionCheck, Put, Update, or Delete object. These can operate on items in different tables, but the tables must reside in the same Amazon Web Services account and Region, and no two of them can operate on the same item.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • return_item_collection_metrics(ReturnItemCollectionMetrics) / set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>):
      required: false

      Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections (if any), that were modified during the operation and are returned in the response. If set to NONE (the default), no statistics are returned.


    • client_request_token(impl Into<String>) / set_client_request_token(Option<String>):
      required: false

      Providing a ClientRequestToken makes the call to TransactWriteItems idempotent, meaning that multiple identical calls have the same effect as one single call.

      Although multiple identical calls using the same client request token produce the same result on the server (no side effects), the responses to the calls might not be the same. If the ReturnConsumedCapacity parameter is set, then the initial TransactWriteItems call returns the amount of write capacity units consumed in making the changes. Subsequent TransactWriteItems calls with the same client token return the number of read capacity units consumed in reading the item.

      A client request token is valid for 10 minutes after the first request that uses it is completed. After 10 minutes, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 10 minutes, or the result might not be idempotent.

      If you submit a request with the same client token but a change in other parameters within the 10-minute idempotency window, DynamoDB returns an IdempotentParameterMismatch exception.


  • On success, responds with TransactWriteItemsOutput with field(s):
  • On failure, responds with SdkError<TransactWriteItemsError>
source§

impl Client

source

pub fn untag_resource(&self) -> UntagResourceFluentBuilder

Constructs a fluent builder for the UntagResource operation.

source§

impl Client

source

pub fn update_continuous_backups(&self) -> UpdateContinuousBackupsFluentBuilder

Constructs a fluent builder for the UpdateContinuousBackups operation.

source§

impl Client

source

pub fn update_contributor_insights( &self, ) -> UpdateContributorInsightsFluentBuilder

Constructs a fluent builder for the UpdateContributorInsights operation.

source§

impl Client

source

pub fn update_global_table(&self) -> UpdateGlobalTableFluentBuilder

Constructs a fluent builder for the UpdateGlobalTable operation.

source§

impl Client

source

pub fn update_global_table_settings( &self, ) -> UpdateGlobalTableSettingsFluentBuilder

Constructs a fluent builder for the UpdateGlobalTableSettings operation.

source§

impl Client

source

pub fn update_item(&self) -> UpdateItemFluentBuilder

Constructs a fluent builder for the UpdateItem operation.

  • The fluent builder is configurable:
    • table_name(impl Into<String>) / set_table_name(Option<String>):
      required: true

      The name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.


    • key(impl Into<String>, AttributeValue) / set_key(Option<HashMap::<String, AttributeValue>>):
      required: true

      The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.

      For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.


    • attribute_updates(impl Into<String>, AttributeValueUpdate) / set_attribute_updates(Option<HashMap::<String, AttributeValueUpdate>>):
      required: false

      This is a legacy parameter. Use UpdateExpression instead. For more information, see AttributeUpdates in the Amazon DynamoDB Developer Guide.


    • expected(impl Into<String>, ExpectedAttributeValue) / set_expected(Option<HashMap::<String, ExpectedAttributeValue>>):
      required: false

      This is a legacy parameter. Use ConditionExpression instead. For more information, see Expected in the Amazon DynamoDB Developer Guide.


    • conditional_operator(ConditionalOperator) / set_conditional_operator(Option<ConditionalOperator>):
      required: false

      This is a legacy parameter. Use ConditionExpression instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide.


    • return_values(ReturnValue) / set_return_values(Option<ReturnValue>):
      required: false

      Use ReturnValues if you want to get the item attributes as they appear before or after they are successfully updated. For UpdateItem, the valid values are:

      • NONE - If ReturnValues is not specified, or if its value is NONE, then nothing is returned. (This setting is the default for ReturnValues.)

      • ALL_OLD - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.

      • UPDATED_OLD - Returns only the updated attributes, as they appeared before the UpdateItem operation.

      • ALL_NEW - Returns all of the attributes of the item, as they appear after the UpdateItem operation.

      • UPDATED_NEW - Returns only the updated attributes, as they appear after the UpdateItem operation.

      There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.

      The values returned are strongly consistent.


    • return_consumed_capacity(ReturnConsumedCapacity) / set_return_consumed_capacity(Option<ReturnConsumedCapacity>):
      required: false

      Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:

      • INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

        Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

      • TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

      • NONE - No ConsumedCapacity details are included in the response.


    • return_item_collection_metrics(ReturnItemCollectionMetrics) / set_return_item_collection_metrics(Option<ReturnItemCollectionMetrics>):
      required: false

      Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to NONE (the default), no statistics are returned.


    • update_expression(impl Into<String>) / set_update_expression(Option<String>):
      required: false

      An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.

      The following action values are available for UpdateExpression.

      • SET - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use SET to add or subtract from an attribute that is of type Number. For example: SET myNum = myNum + :val

        SET supports the following functions:

        • if_not_exists (path, operand) - if the item does not contain an attribute at the specified path, then if_not_exists evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.

        • list_append (operand, operand) - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.

        These function names are case-sensitive.

      • REMOVE - Removes one or more attributes from an item.

      • ADD - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of ADD depends on the data type of the attribute:

        • If the existing attribute is a number, and if Value is also a number, then Value is mathematically added to the existing attribute. If Value is a negative number, then it is subtracted from the existing attribute.

          If you use ADD to increment or decrement a number value for an item that doesn’t exist before the update, DynamoDB uses 0 as the initial value.

          Similarly, if you use ADD for an existing item to increment or decrement an attribute value that doesn’t exist before the update, DynamoDB uses 0 as the initial value. For example, suppose that the item you want to update doesn’t have an attribute named itemcount, but you decide to ADD the number 3 to this attribute anyway. DynamoDB will create the itemcount attribute, set its initial value to 0, and finally add 3 to it. The result will be a new itemcount attribute in the item, with a value of 3.

        • If the existing data type is a set and if Value is also a set, then Value is added to the existing set. For example, if the attribute value is the set [1,2], and the ADD action specified [3], then the final attribute value is [1,2,3]. An error occurs if an ADD action is specified for a set attribute and the attribute type specified does not match the existing set type.

          Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the Value must also be a set of strings.

        The ADD action only supports Number and set data types. In addition, ADD can only be used on top-level attributes, not nested attributes.

      • DELETE - Deletes an element from a set.

        If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set [a,b,c] and the DELETE action specifies [a,c], then the final attribute value is [b]. Specifying an empty set is an error.

        The DELETE action only supports set data types. In addition, DELETE can only be used on top-level attributes, not nested attributes.

      You can have many actions in a single expression, such as the following: SET a=:value1, b=:value2 DELETE :value3, :value4, :value5

      For more information on update expressions, see Modifying Items and Attributes in the Amazon DynamoDB Developer Guide.


    • condition_expression(impl Into<String>) / set_condition_expression(Option<String>):
      required: false

      A condition that must be satisfied in order for a conditional update to succeed.

      An expression can contain any of the following:

      • Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size

        These function names are case-sensitive.

      • Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN

      • Logical operators: AND | OR | NOT

      For more information about condition expressions, see Specifying Conditions in the Amazon DynamoDB Developer Guide.


    • expression_attribute_names(impl Into<String>, impl Into<String>) / set_expression_attribute_names(Option<HashMap::<String, String>>):
      required: false

      One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

      • To access an attribute whose name conflicts with a DynamoDB reserved word.

      • To create a placeholder for repeating occurrences of an attribute name in an expression.

      • To prevent special characters in an attribute name from being misinterpreted in an expression.

      Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

      • Percentile

      The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.) To work around this, you could specify the following for ExpressionAttributeNames:

      • {“#P”:“Percentile”}

      You could then use this substitution in an expression, as in this example:

      • #P = :val

      Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

      For more information about expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.


    • expression_attribute_values(impl Into<String>, AttributeValue) / set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>):
      required: false

      One or more values that can be substituted in an expression.

      Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

      Available | Backordered | Discontinued

      You would first need to specify ExpressionAttributeValues as follows:

      { “:avail”:{“S”:“Available”}, “:back”:{“S”:“Backordered”}, “:disc”:{“S”:“Discontinued”} }

      You could then use these values in an expression, such as this:

      ProductStatus IN (:avail, :back, :disc)

      For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide.


    • return_values_on_condition_check_failure(ReturnValuesOnConditionCheckFailure) / set_return_values_on_condition_check_failure(Option<ReturnValuesOnConditionCheckFailure>):
      required: false

      An optional parameter that returns the item attributes for an UpdateItem operation that failed a condition check.

      There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.


  • On success, responds with UpdateItemOutput with field(s):
    • attributes(Option<HashMap::<String, AttributeValue>>):

      A map of attribute values as they appear before or after the UpdateItem operation, as determined by the ReturnValues parameter.

      The Attributes map is only present if the update was successful and ReturnValues was specified as something other than NONE in the request. Each element represents one attribute.

    • consumed_capacity(Option<ConsumedCapacity>):

      The capacity units consumed by the UpdateItem operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified. For more information, see Capacity unity consumption for write operations in the Amazon DynamoDB Developer Guide.

    • item_collection_metrics(Option<ItemCollectionMetrics>):

      Information about item collections, if any, that were affected by the UpdateItem operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.

      Each ItemCollectionMetrics element consists of:

      • ItemCollectionKey - The partition key value of the item collection. This is the same as the partition key value of the item itself.

      • SizeEstimateRangeGB - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.

        The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

  • On failure, responds with SdkError<UpdateItemError>
source§

impl Client

source

pub fn update_kinesis_streaming_destination( &self, ) -> UpdateKinesisStreamingDestinationFluentBuilder

Constructs a fluent builder for the UpdateKinesisStreamingDestination operation.

source§

impl Client

source

pub fn update_table(&self) -> UpdateTableFluentBuilder

Constructs a fluent builder for the UpdateTable operation.

source§

impl Client

source

pub fn update_table_replica_auto_scaling( &self, ) -> UpdateTableReplicaAutoScalingFluentBuilder

Constructs a fluent builder for the UpdateTableReplicaAutoScaling operation.

source§

impl Client

source

pub fn update_time_to_live(&self) -> UpdateTimeToLiveFluentBuilder

Constructs a fluent builder for the UpdateTimeToLive operation.

source§

impl Client

source

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 and time_source configured.
  • No behavior_version is provided.

The panic message for each of these will have instructions on how to resolve them.

source

pub fn config(&self) -> &Config

Returns the client’s configuration.

source§

impl Client

source

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 the sleep_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 the http_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, set behavior_version on the Config or enable the behavior-version-latest Cargo feature.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Waiters for Client

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> Paint for T
where T: ?Sized,

§

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();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color::Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color::Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color::White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightWhite].

§Example
println!("{}", value.bright_white());
§

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();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color::Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color::Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color::White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

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();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute::Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute::RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Strike].

§Example
println!("{}", value.strike());
§

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();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Linger].

§Example
println!("{}", value.linger());
§

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.

Returns self with the quirk() set to [Quirk::Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::OnBright].

§Example
println!("{}", value.on_bright());
§

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);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more