Unverified Commit b62756ca authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Add missing docs to `aws-smithy-runtime` and move the clock skew interceptor (#2871)

This PR adds missing documentation to the `aws-smith-runtime` crate, and
moves the `ServiceClockSkewInterceptor` into the `aws-runtime` crate.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent e4099600
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ aws-smithy-checksums = { path = "../../../rust-runtime/aws-smithy-checksums" }
aws-smithy-client = { path = "../../../rust-runtime/aws-smithy-client" }
aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" }
aws-smithy-http-tower = { path = "../../../rust-runtime/aws-smithy-http-tower" }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api" }
aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime" }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", features = ["client"] }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" }
aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" }
aws-types = { path = "../aws-types" }
+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ aws-sigv4 = { path = "../aws-sigv4" }
aws-smithy-async = { path = "../../../rust-runtime/aws-smithy-async" }
aws-smithy-eventstream = { path = "../../../rust-runtime/aws-smithy-eventstream", optional = true }
aws-smithy-http = { path = "../../../rust-runtime/aws-smithy-http" }
aws-smithy-runtime = { path = "../../../rust-runtime/aws-smithy-runtime", features = ["client"] }
aws-smithy-runtime-api = { path = "../../../rust-runtime/aws-smithy-runtime-api", features = ["client"] }
aws-smithy-types = { path = "../../../rust-runtime/aws-smithy-types" }
aws-types = { path = "../aws-types" }
+3 −0
Original line number Diff line number Diff line
@@ -33,3 +33,6 @@ pub mod invocation_id;

/// Supporting code for request metadata headers in the AWS SDK.
pub mod request_info;

/// Interceptor that determines the clock skew between the client and service.
pub mod service_clock_skew;
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * SPDX-License-Identifier: Apache-2.0
 */

use aws_smithy_runtime::client::orchestrator::interceptors::ServiceClockSkew;
use crate::service_clock_skew::ServiceClockSkew;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
use aws_smithy_runtime_api::client::interceptors::Interceptor;
+5 −6
Original line number Diff line number Diff line
@@ -12,9 +12,10 @@ use aws_smithy_types::date_time::Format;
use aws_smithy_types::DateTime;
use std::time::{Duration, SystemTime};

/// Amount of clock skew between the client and the service.
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct ServiceClockSkew {
pub(crate) struct ServiceClockSkew {
    inner: Duration,
}

@@ -22,10 +23,6 @@ impl ServiceClockSkew {
    fn new(inner: Duration) -> Self {
        Self { inner }
    }

    pub fn skew(&self) -> Duration {
        self.inner
    }
}

impl Storable for ServiceClockSkew {
@@ -38,11 +35,13 @@ impl From<ServiceClockSkew> for Duration {
    }
}

/// Interceptor that determines the clock skew between the client and service.
#[derive(Debug, Default)]
#[non_exhaustive]
pub struct ServiceClockSkewInterceptor {}
pub struct ServiceClockSkewInterceptor;

impl ServiceClockSkewInterceptor {
    /// Creates a new `ServiceClockSkewInterceptor`.
    pub fn new() -> Self {
        Self::default()
    }
Loading