Skip to content

Commit a6c961a

Browse files
committed
Update to rusoto 0.46, tokio 1.0 and a few others.
Small refactor to simplify rustls feature usage.
1 parent fbc946c commit a6c961a

File tree

4 files changed

+115
-22
lines changed

4 files changed

+115
-22
lines changed

dynomite/Cargo.toml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,47 @@ maintenance = { status = "actively-developed" }
1919
[dependencies]
2020
async-trait = "0.1"
2121
again = "0.1"
22-
bytes = "0.5"
22+
bytes = "1"
2323
dynomite-derive = { version = "0.10.0", path = "../dynomite-derive", optional = true }
2424
futures = "0.3"
2525
log = "0.4"
26-
rusoto_core_default = { package = "rusoto_core", version = "0.45", optional = true }
27-
rusoto_core_rustls = { package = "rusoto_core", version = "0.45", default_features = false, features=["rustls"], optional = true }
28-
rusoto_dynamodb_default = { package = "rusoto_dynamodb", version = "0.45", optional = true }
29-
rusoto_dynamodb_rustls = { package = "rusoto_dynamodb", version = "0.45", default_features = false, features=["rustls"], optional = true }
26+
# Disable default features since the `rustls` variant requires it. We re-enable `default` in our
27+
# `default` build configuration - see the [features] below.
28+
rusoto_core = { version = "0.46", optional = true, default_features = false }
29+
rusoto_dynamodb = { version = "0.46", optional = true, default_features = false }
3030
uuid = { version = "0.8", features = ["v4"], optional = true }
3131
chrono = { version = "0.4", optional = true }
3232

3333
[dev-dependencies]
34-
env_logger = "0.7"
34+
env_logger = "0.8"
3535
maplit = "1.0"
3636
serde = "1.0"
3737
serde_json = "1.0"
38-
tokio = { version = "0.2", features = ["macros"] }
38+
tokio = { version = "1", features = ["macros"] }
3939
lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", branch = "master"}
4040
trybuild = "1.0"
4141
rustversion = "1.0"
4242
dynomite-derive = { version = "0.10.0", path = "../dynomite-derive" } # required by trybuild
4343

4444
[features]
45-
default = ["uuid", "chrono", "derive", "rusoto_core_default", "rusoto_dynamodb_default"]
46-
rustls = ["uuid", "chrono", "derive", "rusoto_core_rustls", "rusoto_dynamodb_rustls"]
45+
default = [
46+
"uuid",
47+
"chrono",
48+
"derive",
49+
"rusoto_core",
50+
"rusoto_dynamodb",
51+
# Enable the `default` features of these crates.
52+
"rusoto_core/default",
53+
"rusoto_dynamodb/default"
54+
]
55+
56+
rustls = [
57+
"uuid",
58+
"chrono",
59+
"derive",
60+
"rusoto_core",
61+
"rusoto_dynamodb",
62+
"rusoto_core/rustls",
63+
"rusoto_dynamodb/rustls"
64+
]
4765
derive = ["dynomite-derive"]

dynomite/src/ext.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ use crate::dynamodb::{
55
ListTablesInput, QueryError, QueryInput, ScanError, ScanInput,
66
};
77
use futures::{stream, Stream, TryStreamExt};
8-
#[cfg(feature = "default")]
9-
use rusoto_core_default::RusotoError;
10-
#[cfg(feature = "rustls")]
11-
use rusoto_core_rustls::RusotoError;
8+
use rusoto_core::RusotoError;
129
use std::{collections::HashMap, pin::Pin};
1310

1411
type DynomiteStream<I, E> = Pin<Box<dyn Stream<Item = Result<I, RusotoError<E>>> + Send>>;

dynomite/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,19 @@
340340
#![deny(missing_docs)]
341341
// reexported
342342
// note: this is used inside the attr_map! macro
343-
#[cfg(feature = "default")]
344-
pub use rusoto_dynamodb_default as dynamodb;
345-
346-
#[cfg(feature = "rustls")]
347-
pub use rusoto_dynamodb_rustls as dynamodb;
343+
// #[cfg(feature = "default")]
344+
// pub use rusoto_dynamodb_default as dynamodb;
345+
//
346+
// #[cfg(feature = "rustls")]
347+
// pub use rusoto_dynamodb_rustls as dynamodb;
348348

349349
use bytes::Bytes;
350350
#[cfg(feature = "chrono")]
351351
use chrono::{
352352
offset::{FixedOffset, Local},
353353
DateTime, Utc,
354354
};
355+
pub use rusoto_dynamodb as dynamodb;
355356

356357
// we re-export this because we
357358
// refer to it with in derive macros

dynomite/src/retry.rs

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
use crate::dynamodb::*;
2121
use again::{Condition, RetryPolicy};
2222
use log::debug;
23-
#[cfg(feature = "default")]
24-
use rusoto_core_default::RusotoError;
25-
#[cfg(feature = "rustls")]
26-
use rusoto_core_rustls::RusotoError;
23+
use rusoto_core::RusotoError;
2724
use std::{sync::Arc, time::Duration};
2825

2926
/// Pre-configured retry policies for fallible operations
@@ -304,6 +301,13 @@ where
304301
.await
305302
}
306303

304+
async fn describe_export(
305+
&self,
306+
input: DescribeExportInput,
307+
) -> Result<DescribeExportOutput, RusotoError<DescribeExportError>> {
308+
self.inner.client.describe_export(input).await
309+
}
310+
307311
async fn describe_continuous_backups(
308312
&self,
309313
input: DescribeContinuousBackupsInput,
@@ -460,6 +464,13 @@ where
460464
.await
461465
}
462466

467+
async fn list_exports(
468+
&self,
469+
input: ListExportsInput,
470+
) -> Result<ListExportsOutput, RusotoError<ListExportsError>> {
471+
self.inner.client.list_exports(input).await
472+
}
473+
463474
async fn list_contributor_insights(
464475
&self,
465476
input: ListContributorInsightsInput,
@@ -802,6 +813,72 @@ where
802813
)
803814
.await
804815
}
816+
817+
async fn batch_execute_statement(
818+
&self,
819+
input: BatchExecuteStatementInput,
820+
) -> Result<BatchExecuteStatementOutput, RusotoError<BatchExecuteStatementError>> {
821+
self.inner.client.batch_execute_statement(input).await
822+
}
823+
824+
async fn execute_statement(
825+
&self,
826+
input: ExecuteStatementInput,
827+
) -> Result<ExecuteStatementOutput, RusotoError<ExecuteStatementError>> {
828+
self.inner.client.execute_statement(input).await
829+
}
830+
831+
async fn execute_transaction(
832+
&self,
833+
input: ExecuteTransactionInput,
834+
) -> Result<ExecuteTransactionOutput, RusotoError<ExecuteTransactionError>> {
835+
self.inner.client.execute_transaction(input).await
836+
}
837+
838+
async fn describe_kinesis_streaming_destination(
839+
&self,
840+
input: DescribeKinesisStreamingDestinationInput,
841+
) -> Result<
842+
DescribeKinesisStreamingDestinationOutput,
843+
RusotoError<DescribeKinesisStreamingDestinationError>,
844+
> {
845+
self.inner
846+
.client
847+
.describe_kinesis_streaming_destination(input)
848+
.await
849+
}
850+
851+
async fn enable_kinesis_streaming_destination(
852+
&self,
853+
input: KinesisStreamingDestinationInput,
854+
) -> Result<
855+
KinesisStreamingDestinationOutput,
856+
RusotoError<EnableKinesisStreamingDestinationError>,
857+
> {
858+
self.inner
859+
.client
860+
.enable_kinesis_streaming_destination(input)
861+
.await
862+
}
863+
864+
async fn disable_kinesis_streaming_destination(
865+
&self,
866+
input: KinesisStreamingDestinationInput,
867+
) -> Result<
868+
KinesisStreamingDestinationOutput,
869+
RusotoError<DisableKinesisStreamingDestinationError>,
870+
> {
871+
self.inner
872+
.disable_kinesis_streaming_destination(input)
873+
.await
874+
}
875+
876+
async fn export_table_to_point_in_time(
877+
&self,
878+
input: ExportTableToPointInTimeInput,
879+
) -> Result<ExportTableToPointInTimeOutput, RusotoError<ExportTableToPointInTimeError>> {
880+
self.inner.client.export_table_to_point_in_time(input).await
881+
}
805882
}
806883

807884
/// retry impl for Service error types

0 commit comments

Comments
 (0)