aws_sdk_keyspacesstreams/lib.rs
1#![allow(deprecated)]
2#![allow(unknown_lints)]
3#![allow(clippy::module_inception)]
4#![allow(clippy::upper_case_acronyms)]
5#![allow(clippy::large_enum_variant)]
6#![allow(clippy::wrong_self_convention)]
7#![allow(clippy::should_implement_trait)]
8#![allow(clippy::disallowed_names)]
9#![allow(clippy::vec_init_then_push)]
10#![allow(clippy::type_complexity)]
11#![allow(clippy::needless_return)]
12#![allow(clippy::derive_partial_eq_without_eq)]
13#![allow(clippy::result_large_err)]
14#![allow(clippy::unnecessary_map_on_constructor)]
15#![allow(rustdoc::bare_urls)]
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::invalid_html_tags)]
18#![forbid(unsafe_code)]
19#![warn(missing_docs)]
20#![cfg_attr(docsrs, feature(doc_auto_cfg))]
21//! Amazon Keyspaces (for Apache Cassandra) change data capture (CDC) records change events for Amazon Keyspaces tables. The change events captured in a stream are time-ordered and de-duplicated write operations. Using stream data you can build event driven applications that incorporate near-real time change events from Amazon Keyspaces tables.
22//!
23//! Amazon Keyspaces CDC is serverless and scales the infrastructure for change events automatically based on the volume of changes on your table.
24//!
25//! This API reference describes the Amazon Keyspaces CDC stream API in detail.
26//!
27//! For more information about Amazon Keyspaces CDC, see [Working with change data capture (CDC) streams in Amazon Keyspaces](https://docs.aws.amazon.com/keyspaces/latest/devguide/cdc.html) in the _Amazon Keyspaces Developer Guide_.
28//!
29//! To learn how Amazon Keyspaces CDC API actions are recorded with CloudTrail, see [Amazon Keyspaces information in CloudTrail](https://docs.aws.amazon.com/keyspaces/latest/devguide/logging-using-cloudtrail.html#service-name-info-in-cloudtrail) in the _Amazon Keyspaces Developer Guide_.
30//!
31//! To see the metrics Amazon Keyspaces CDC sends to Amazon CloudWatch, see [Amazon Keyspaces change data capture (CDC) CloudWatch metrics](https://docs.aws.amazon.com/keyspaces/latest/devguide/metrics-dimensions.html#keyspaces-cdc-metrics) in the _Amazon Keyspaces Developer Guide_.
32//!
33//! ## Getting Started
34//!
35//! > Examples are available for many services and operations, check out the
36//! > [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples).
37//!
38//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
39//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-keyspacesstreams` to
40//! your project, add the following to your **Cargo.toml** file:
41//!
42//! ```toml
43//! [dependencies]
44//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
45//! aws-sdk-keyspacesstreams = "1.5.0"
46//! tokio = { version = "1", features = ["full"] }
47//! ```
48//!
49//! Then in code, a client can be created with the following:
50//!
51//! ```rust,no_run
52//! use aws_sdk_keyspacesstreams as keyspacesstreams;
53//!
54//! #[::tokio::main]
55//! async fn main() -> Result<(), keyspacesstreams::Error> {
56//! let config = aws_config::load_from_env().await;
57//! let client = aws_sdk_keyspacesstreams::Client::new(&config);
58//!
59//! // ... make some calls with the client
60//!
61//! Ok(())
62//! }
63//! ```
64//!
65//! See the [client documentation](https://docs.rs/aws-sdk-keyspacesstreams/latest/aws_sdk_keyspacesstreams/client/struct.Client.html)
66//! for information on what calls can be made, and the inputs and outputs for each of those calls.
67//!
68//! ## Using the SDK
69//!
70//! Until the SDK is released, we will be adding information about using the SDK to the
71//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
72//! additional sections for the guide by opening an issue and describing what you are trying to do.
73//!
74//! ## Getting Help
75//!
76//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
77//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
78//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
79//! * [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples)
80//!
81//!
82//! # Crate Organization
83//!
84//! The entry point for most customers will be [`Client`], which exposes one method for each API
85//! offered by Amazon Keyspaces Streams. The return value of each of these methods is a "fluent builder",
86//! where the different inputs for that API are added by builder-style function call chaining,
87//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
88//! either a successful output or a [`SdkError`](crate::error::SdkError).
89//!
90//! Some of these API inputs may be structs or enums to provide more complex structured information.
91//! These structs and enums live in [`types`](crate::types). There are some simpler types for
92//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
93//!
94//! All types required to configure a client via the [`Config`](crate::Config) struct live
95//! in [`config`](crate::config).
96//!
97//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
98//! is the input, output, and error type for that API, as well as builders to construct each of those.
99//!
100//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
101//! client can return. Any other error type can be converted to this `Error` type via the
102//! [`From`](std::convert::From) trait.
103//!
104//! The other modules within this crate are not required for normal usage.
105
106// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
107pub use error_meta::Error;
108
109#[doc(inline)]
110pub use config::Config;
111
112/// Client for calling Amazon Keyspaces Streams.
113/// ## Constructing a `Client`
114///
115/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
116/// crate should be used to automatically resolve this config using
117/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
118/// across multiple different AWS SDK clients. This config resolution process can be customized
119/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
120/// the [builder pattern] to customize the default config.
121///
122/// In the simplest case, creating a client looks as follows:
123/// ```rust,no_run
124/// # async fn wrapper() {
125/// let config = aws_config::load_from_env().await;
126/// let client = aws_sdk_keyspacesstreams::Client::new(&config);
127/// # }
128/// ```
129///
130/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
131/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
132/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
133/// done as follows:
134///
135/// ```rust,no_run
136/// # async fn wrapper() {
137/// let sdk_config = ::aws_config::load_from_env().await;
138/// let config = aws_sdk_keyspacesstreams::config::Builder::from(&sdk_config)
139/// # /*
140/// .some_service_specific_setting("value")
141/// # */
142/// .build();
143/// # }
144/// ```
145///
146/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
147///
148/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
149/// be done once at application start-up.
150///
151/// [`Config`]: crate::Config
152/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
153/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
154/// [`aws-config` docs]: https://docs.rs/aws-config/*
155/// [`aws-config`]: https://crates.io/crates/aws-config
156/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
157/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
158/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
159/// # Using the `Client`
160///
161/// A client has a function for every operation that can be performed by the service.
162/// For example, the [`GetRecords`](crate::operation::get_records) operation has
163/// a [`Client::get_records`], function which returns a builder for that operation.
164/// The fluent builder ultimately has a `send()` function that returns an async future that
165/// returns a result, as illustrated below:
166///
167/// ```rust,ignore
168/// let result = client.get_records()
169/// .shard_iterator("example")
170/// .send()
171/// .await;
172/// ```
173///
174/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
175/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
176/// information.
177pub mod client;
178
179/// Configuration for Amazon Keyspaces Streams.
180pub mod config;
181
182/// Common errors and error handling utilities.
183pub mod error;
184
185mod error_meta;
186
187/// Information about this crate.
188pub mod meta;
189
190/// All operations that this crate can perform.
191pub mod operation;
192
193/// Primitives such as `Blob` or `DateTime` used by other types.
194pub mod primitives;
195
196/// Data structures used by operation inputs/outputs.
197pub mod types;
198
199pub(crate) mod protocol_serde;
200
201mod sdk_feature_tracker;
202
203mod serialization_settings;
204
205mod endpoint_lib;
206
207mod lens;
208
209mod serde_util;
210
211mod json_errors;
212
213#[doc(inline)]
214pub use client::Client;