id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator.rs:10 | ) -> Self {
self.schemes.push((name, Box::new(auth_scheme) as _));
self
}
pub fn build(self) -> HttpAuthSchemes {
HttpAuthSchemes {
inner: Arc::new(HttpAuthSchemesInner {
schemes: self.schemes,
}),
}
... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator.rs | Apache-2.0 | 859d18e93f161db478e19f9db7e21ba30092426e | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/859d18e93f161db478e19f9db7e21ba30092426e/sdk/aws-smithy-runtime-api/src/client/orchestrator.rs | 361 | 374 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use super::BoxError;
use crate::client::interceptors::context::phase::Phase;
use crate::client::interceptors::InterceptorError;
use crate::client::orchestrator::HttpResponse;
use aws_smithy_http::result:... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:2 | }
/// Create a new `OrchestratorError::Interceptor` from an [`InterceptorError`].
pub fn interceptor(err: InterceptorError) -> Self {
Self::Interceptor { err }
}
/// Create a new `OrchestratorError::Timeout` from a [`BoxError`].
pub fn timeout(err: BoxError) -> Self {
Self::Timeout... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:3 | match phase {
BeforeSerialization | Serialization => SdkError::construction_failure(err),
BeforeTransmit | Transmit => match response {
Some(response) => SdkError::response_error(err, response),
None => SdkError::dispatch_failure(Co... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:4 | Err(e) => e,
};
match response {
Some(response) => SdkError::response_error(err, response),
None => SdkError::dispatch_failure(ConnectorError::other(err, None)),
}
}
impl<E> From<InterceptorError> for OrchestratorError<E>
where
E: Debug + std::error::Error + 'static,
{
fn from(err: ... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 121 | 151 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:2 | }
/// Create a new `OrchestratorError::Interceptor` from an [`InterceptorError`].
pub fn interceptor(err: InterceptorError) -> Self {
Self::Interceptor { err }
}
/// Create a new `OrchestratorError::Timeout` from a [`BoxError`].
pub fn timeout(err: BoxError) -> Self {
Self::Timeout... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 439cfbfe8cfcb933aea803c992f37f76575a48e4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/439cfbfe8cfcb933aea803c992f37f76575a48e4/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use super::BoxError;
use crate::client::interceptors::context::phase::Phase;
use crate::client::interceptors::InterceptorError;
use crate::client::orchestrator::HttpResponse;
use aws_smithy_http::result:... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 662f0cfa80e76241decffdda5acd8765330fe1c9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/662f0cfa80e76241decffdda5acd8765330fe1c9/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:2 | /// Convert the `OrchestratorError` into `Some` operation specific error if it is one. Otherwise,
/// return `None`.
pub fn as_operation_error(&self) -> Option<&E> {
match self {
Self::Operation { err } => Some(err),
_ => None,
}
}
/// Convert the `OrchestratorEr... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 662f0cfa80e76241decffdda5acd8765330fe1c9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/662f0cfa80e76241decffdda5acd8765330fe1c9/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:3 | SdkError::response_error(err, response.expect("phase has a response"))
}
}
}
}
}
}
fn convert_dispatch_error<O>(
err: BoxError,
response: Option<HttpResponse>,
) -> SdkError<O, HttpResponse> {
let err = match err.downcast::<ConnectorError>() {
... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 662f0cfa80e76241decffdda5acd8765330fe1c9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/662f0cfa80e76241decffdda5acd8765330fe1c9/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 81 | 136 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:4 | }
impl From<TypeErasedError> for OrchestratorError<TypeErasedError> {
fn from(err: TypeErasedError) -> Self {
Self::operation(err)
}
}
impl<E> From<aws_smithy_http::byte_stream::error::Error> for OrchestratorError<E>
where
E: Debug + std::error::Error + 'static,
{
fn from(err: aws_smithy_http:... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 662f0cfa80e76241decffdda5acd8765330fe1c9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/662f0cfa80e76241decffdda5acd8765330fe1c9/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 121 | 136 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use super::BoxError;
use crate::client::interceptors::context::phase::Phase;
use crate::client::interceptors::InterceptorError;
use crate::client::orchestrator::HttpResponse;
use aws_smithy_http::result:... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use super::BoxError;
use crate::client::interceptors::context::phase::Phase;
use crate::client::interceptors::InterceptorError;
use crate::client::orchestrator::HttpResponse;
use aws_smithy_http::result:... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 06dc9de36c4c611fb925cf3d203e5cee26ce19bb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/06dc9de36c4c611fb925cf3d203e5cee26ce19bb/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:2 | /// Convert the `OrchestratorError` into an [`SdkError`].
pub fn into_sdk_error(
self,
phase: &Phase,
response: Option<HttpResponse>,
) -> SdkError<E, HttpResponse> {
match self {
Self::Interceptor { err } => {
use Phase::*;
match phase... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 06dc9de36c4c611fb925cf3d203e5cee26ce19bb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/06dc9de36c4c611fb925cf3d203e5cee26ce19bb/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:3 | response: Option<HttpResponse>,
) -> SdkError<O, HttpResponse> {
let err = match err.downcast::<ConnectorError>() {
Ok(connector_error) => {
return SdkError::dispatch_failure(*connector_error);
}
Err(e) => e,
};
match response {
Some(response) => SdkError::respons... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | 06dc9de36c4c611fb925cf3d203e5cee26ce19bb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/06dc9de36c4c611fb925cf3d203e5cee26ce19bb/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 81 | 126 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use super::BoxError;
use crate::client::interceptors::context::phase::Phase;
use crate::client::interceptors::InterceptorError;
use crate::client::orchestrator::HttpResponse;
use crate::type_erasure::Typ... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | d579a1949f060dad9e9a4654881a914f525282ab | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/d579a1949f060dad9e9a4654881a914f525282ab/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs:3 | response: Option<HttpResponse>,
) -> SdkError<O, HttpResponse> {
let err = match err.downcast::<ConnectorError>() {
Ok(connector_error) => {
return SdkError::dispatch_failure(*connector_error);
}
Err(e) => e,
};
match response {
Some(response) => SdkError::respons... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | Apache-2.0 | f76ccb3a8534c5a903b6927d925e2ea966e60bd5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/f76ccb3a8534c5a903b6927d925e2ea966e60bd5/sdk/aws-smithy-runtime-api/src/client/orchestrator/error.rs | 81 | 117 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/request_attempts.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_types::config_bag::{Storable, StoreReplace};
#[derive(Debug, Clone, Copy)]
pub struct RequestAttempts {
attempts: u32,
}
impl RequestAttempts {
#[cfg(any(feature = "test-util", t... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/request_attempts.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime-api/src/client/request_attempts.rs | 1 | 32 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/request_attempts.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_smithy_types::config_bag::{Storable, StoreReplace};
#[derive(Debug, Clone, Copy)]
pub struct RequestAttempts {
attempts: usize,
}
impl RequestAttempts {
#[cfg(any(feature = "test-util",... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/request_attempts.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime-api/src/client/request_attempts.rs | 1 | 32 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/request_attempts.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#[derive(Debug, Clone, Copy)]
pub struct RequestAttempts {
attempts: usize,
}
impl RequestAttempts {
#[cfg(any(feature = "test-util", test))]
pub fn new(attempts: usize) -> Self {
Se... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/request_attempts.rs | Apache-2.0 | 70dbcefe040758bfaa3cf134d5b39379422fe212 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/70dbcefe040758bfaa3cf134d5b39379422fe212/sdk/aws-smithy-runtime-api/src/client/request_attempts.rs | 1 | 26 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Types for [error](SdkError) responses.
use crate::client::connection::ConnectionMetadata;
use aws_smithy_types::error::metadata::{ProvideErrorMetadata, EMPTY_ERROR_METADATA};
use aws_smithy_types::e... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:2 | #[doc = "Sets the error source."]
pub fn set_source(&mut self, source: Option<$sourceType>) -> &mut Self {
self.source = source;
self
}
#[doc = "Builds the error context."]
pub fn build(self) -> $errorName {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:3 | /// Sets the error source.
pub fn source(mut self, source: impl Into<BoxError>) -> Self {
self.source = Some(source.into());
self
}
/// Sets the error source.
pub fn set_source(&mut self, source: Option<BoxError>) -> &mut Self {
self.source = source;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:4 | impl<E, R> Default for ServiceErrorBuilder<E, R> {
fn default() -> Self {
Self {
source: None,
raw: None,
}
}
}
impl<E, R> ServiceErrorBuilder<E, R> {
/// Creates a new builder.
pub fn new() -> Self {
Default::d... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:5 | pub fn build(self) -> ServiceError<E, R> {
ServiceError {
source: self.source.expect("source is required"),
raw: self.raw.expect("a raw response is required"),
}
}
}
}
/// Error context for [`SdkError::ConstructionFailure`]
#[derive(Debug)]
pub struct... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:6 | impl DispatchFailure {
/// Creates a builder for this error context type.
pub fn builder() -> builders::DispatchFailureBuilder {
builders::DispatchFailureBuilder::new()
}
/// Returns true if the error is an IO error
pub fn is_io(&self) -> bool {
self.source.is_io()
}
/// Re... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:7 | pub struct ResponseError<R> {
/// Error encountered while parsing the response
source: BoxError,
/// Raw response that was available
raw: R,
}
impl<R> ResponseError<R> {
/// Creates a builder for this error context type.
pub fn builder() -> builders::ResponseErrorBuilder<R> {
builders::... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:8 | pub fn err(&self) -> &E {
&self.source
}
/// Converts this error context into the underlying error `E`
pub fn into_err(self) -> E {
self.source
}
/// Returns a reference to the raw response
pub fn raw(&self) -> &R {
&self.raw
}
/// Converts this error context i... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:9 | /// The request failed during construction. It was not dispatched over the network.
ConstructionFailure(ConstructionFailure),
/// The request failed due to a timeout. The request MAY have been sent and received.
TimeoutError(TimeoutError),
/// The request failed during dispatch. An HTTP response was n... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:10 | Self::ResponseError(ResponseError {
source: source.into(),
raw,
})
}
/// Construct a `SdkError` for a service failure
pub fn service_error(source: E, raw: R) -> Self {
Self::ServiceError(ServiceError { source, raw })
}
/// Returns the underlying service erro... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:11 | /// # Ok(())
/// # }
/// ```
pub fn into_service_error(self) -> E
where
E: std::error::Error + Send + Sync + CreateUnhandledError + 'static,
R: Debug + Send + Sync + 'static,
{
match self {
Self::ServiceError(context) => context.source,
_ => E::create_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:12 | _ => None,
}
}
/// Converts this error into its error source.
///
/// If there is no error source, then `Err(Self)` is returned.
pub fn into_source(self) -> Result<Box<dyn Error + Send + Sync + 'static>, Self>
where
E: std::error::Error + Send + Sync + 'static,
{
mat... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:13 | SdkError::ResponseError(context) => SdkError::<E2, R>::ResponseError(context),
SdkError::TimeoutError(context) => SdkError::<E2, R>::TimeoutError(context),
}
}
}
impl<E, R> Display for SdkError<E, R> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match self {
Sd... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:14 | impl<E, R> ProvideErrorMetadata for SdkError<E, R>
where
E: ProvideErrorMetadata,
{
fn meta(&self) -> &aws_smithy_types::error::ErrorMetadata {
match self {
SdkError::ConstructionFailure(_) => &EMPTY_ERROR_METADATA,
SdkError::TimeoutError(_) => &EMPTY_ERROR_METADATA,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:15 | connection: ConnectionStatus,
}
#[non_exhaustive]
#[derive(Debug)]
pub(crate) enum ConnectionStatus {
/// This request was never connected to the remote
///
/// This indicates the failure was during connection establishment
NeverConnected,
/// It is unknown whether a connection was established
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:16 | Self {
kind: ConnectorErrorKind::Timeout,
source,
connection: ConnectionStatus::Unknown,
}
}
/// Include connection information along with this error
pub fn with_connection(mut self, info: ConnectionMetadata) -> Self {
self.connection = ConnectionStatus::... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:17 | pub fn other(source: BoxError, kind: Option<ErrorKind>) -> Self {
Self {
source,
kind: ConnectorErrorKind::Other(kind),
connection: ConnectionStatus::Unknown,
}
}
/// Returns true if the error is an IO error
pub fn is_io(&self) -> bool {
matches!(... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 641 | 693 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:18 | /// Returns metadata about the connection
///
/// If a connection was established and provided by the internal connector, a connection will
/// be returned.
pub fn connection_metadata(&self) -> Option<&ConnectionMetadata> {
match &self.connection {
ConnectionStatus::NeverConnected =>... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/result.rs | 681 | 693 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:4 | impl<E, R> Default for ServiceErrorBuilder<E, R> {
fn default() -> Self {
Self {
source: None,
raw: None,
}
}
}
impl<E, R> ServiceErrorBuilder<E, R> {
/// Creates a new builder.
pub fn new() -> Self {
Default::d... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 7e746780f69473d5d0669d5c49c5f1194e8a36c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7e746780f69473d5d0669d5c49c5f1194e8a36c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:5 | pub fn build(self) -> ServiceError<E, R> {
ServiceError {
source: self.source.expect("source is required"),
raw: self.raw.expect("a raw response is required"),
}
}
}
}
/// Error context for [`SdkError::ConstructionFailure`]
#[derive(Debug)]
pub struct... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 7e746780f69473d5d0669d5c49c5f1194e8a36c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7e746780f69473d5d0669d5c49c5f1194e8a36c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:10 | Self::ResponseError(ResponseError {
source: source.into(),
raw,
})
}
/// Construct a `SdkError` for a service failure
pub fn service_error(source: E, raw: R) -> Self {
Self::ServiceError(ServiceError { source, raw })
}
/// Returns the underlying service erro... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:11 | /// # Ok(())
/// # }
/// ```
pub fn into_service_error(self) -> E
where
E: std::error::Error + Send + Sync + CreateUnhandledError + 'static,
R: Debug + Send + Sync + 'static,
{
match self {
Self::ServiceError(context) => context.source,
_ => E::create_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:12 | pub fn map_service_error<E2>(self, map: impl FnOnce(E) -> E2) -> SdkError<E2, R> {
match self {
SdkError::ServiceError(context) => SdkError::<E2, R>::ServiceError(ServiceError {
source: map(context.source),
raw: context.raw,
}),
SdkError::Const... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:13 | }
}
}
impl<E, R> From<BuildError> for SdkError<E, R> {
fn from(value: BuildError) -> Self {
SdkError::ConstructionFailure(ConstructionFailure::builder().source(value).build())
}
}
impl<E, R> ProvideErrorMetadata for SdkError<E, R>
where
E: ProvideErrorMetadata,
{
fn meta(&self) -> &aws_smi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:14 | /// Error from the underlying Connector
///
/// Connector exists to attach a `ConnectorErrorKind` to what would otherwise be an opaque `Box<dyn Error>`
/// that comes off a potentially generic or dynamic connector.
/// The attached `kind` is used to determine what retry behavior should occur (if any) based on the
/// c... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:15 | fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(self.source.as_ref())
}
}
impl ConnectorError {
/// Construct a [`ConnectorError`] from an error caused by a timeout
///
/// Timeout errors are typically retried on a new connection.
pub fn timeout(source: BoxError) -> Self {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:16 | Self {
kind: ConnectorErrorKind::Io,
source,
connection: ConnectionStatus::Unknown,
}
}
/// Construct a [`ConnectorError`] from an different unclassified error.
///
/// Optionally, an explicit `Kind` may be passed.
pub fn other(source: BoxError, kind: Opt... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:17 | match &self.kind {
ConnectorErrorKind::Other(ek) => *ek,
_ => None,
}
}
/// Grants ownership of this error's source.
pub fn into_source(self) -> BoxError {
self.source
}
/// Returns metadata about the connection
///
/// If a connection was establishe... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/aws-smithy-runtime-api/src/client/result.rs | 641 | 663 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Types for [error](SdkError) responses.
use crate::client::connection::ConnectionMetadata;
use aws_smithy_types::error::metadata::{ProvideErrorMetadata, EMPTY_ERROR_METADATA};
use aws_smithy_types::e... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/aws-smithy-runtime-api/src/client/result.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:2 | #[doc = "Sets the error source."]
pub fn set_source(&mut self, source: Option<$sourceType>) -> &mut Self {
self.source = source;
self
}
#[doc = "Builds the error context."]
pub fn build(self) -> $errorName {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/aws-smithy-runtime-api/src/client/result.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:3 | /// Sets the error source.
pub fn source(mut self, source: impl Into<BoxError>) -> Self {
self.source = Some(source.into());
self
}
/// Sets the error source.
pub fn set_source(&mut self, source: Option<BoxError>) -> &mut Self {
self.source = source;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/aws-smithy-runtime-api/src/client/result.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:8 | pub fn err(&self) -> &E {
&self.source
}
/// Converts this error context into the underlying error `E`
pub fn into_err(self) -> E {
self.source
}
/// Returns a reference to the raw response
pub fn raw(&self) -> &R {
&self.raw
}
/// Converts this error context i... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/aws-smithy-runtime-api/src/client/result.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:11 | /// # Ok(())
/// # }
/// ```
pub fn into_service_error(self) -> E
where
E: std::error::Error + Send + Sync + CreateUnhandledError + 'static,
R: Debug + Send + Sync + 'static,
{
match self {
Self::ServiceError(context) => context.source,
_ => E::create_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:12 | #[doc(hidden)]
pub fn map_service_error<E2>(self, map: impl FnOnce(E) -> E2) -> SdkError<E2, R> {
match self {
SdkError::ServiceError(context) => SdkError::<E2, R>::ServiceError(ServiceError {
source: map(context.source),
raw: context.raw,
}),
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:13 | SdkError::ServiceError(context) => Some(&context.source),
}
}
}
impl<E, R> From<BuildError> for SdkError<E, R> {
fn from(value: BuildError) -> Self {
SdkError::ConstructionFailure(ConstructionFailure::builder().source(value).build())
}
}
impl<E, R> ProvideErrorMetadata for SdkError<E, R>
w... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:14 | /// Error from the underlying Connector
///
/// Connector exists to attach a `ConnectorErrorKind` to what would otherwise be an opaque `Box<dyn Error>`
/// that comes off a potentially generic or dynamic connector.
/// The attached `kind` is used to determine what retry behavior should occur (if any) based on the
/// c... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:15 | impl Error for ConnectorError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(self.source.as_ref())
}
}
impl ConnectorError {
/// Construct a [`ConnectorError`] from an error caused by a timeout
///
/// Timeout errors are typically retried on a new connection.
pub fn timeout... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:16 | pub fn io(source: BoxError) -> Self {
Self {
kind: ConnectorErrorKind::Io,
source,
connection: ConnectionStatus::Unknown,
}
}
/// Construct a [`ConnectorError`] from an different unclassified error.
///
/// Optionally, an explicit `Kind` may be passed... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:17 | pub fn as_other(&self) -> Option<ErrorKind> {
match &self.kind {
ConnectorErrorKind::Other(ek) => *ek,
_ => None,
}
}
/// Grants ownership of this error's source.
pub fn into_source(self) -> BoxError {
self.source
}
/// Returns metadata about the con... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | 879878b868b809775292dda9db2be8dc85d69629 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/879878b868b809775292dda9db2be8dc85d69629/sdk/aws-smithy-runtime-api/src/client/result.rs | 641 | 664 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Types for [error](SdkError) responses.
use crate::client::connection::ConnectionMetadata;
use aws_smithy_types::error::metadata::{ProvideErrorMetadata, EMPTY_ERROR_METADATA};
use aws_smithy_types::e... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:2 | pub fn set_source(&mut self, source: Option<$sourceType>) -> &mut Self {
self.source = source;
self
}
#[doc = "Builds the error context."]
pub fn build(self) -> $errorName {
$errorName { source: self.source.expe... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:3 | pub fn source(mut self, source: impl Into<BoxError>) -> Self {
self.source = Some(source.into());
self
}
/// Sets the error source.
pub fn set_source(&mut self, source: Option<BoxError>) -> &mut Self {
self.source = source;
self
}
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:4 | fn default() -> Self {
Self {
source: None,
raw: None,
}
}
}
impl<E, R> ServiceErrorBuilder<E, R> {
/// Creates a new builder.
pub fn new() -> Self {
Default::default()
}
/// Sets the error source.
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:5 | ServiceError {
source: self.source.expect("source is required"),
raw: self.raw.expect("a raw response is required"),
}
}
}
}
/// Error context for [`SdkError::ConstructionFailure`]
#[derive(Debug)]
pub struct ConstructionFailure {
source: BoxError,
}
impl Co... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:6 | impl DispatchFailure {
/// Creates a builder for this error context type.
pub fn builder() -> builders::DispatchFailureBuilder {
builders::DispatchFailureBuilder::new()
}
/// Returns true if the error is an IO error
pub fn is_io(&self) -> bool {
self.source.is_io()
}
/// Re... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:7 | /// Error encountered while parsing the response
source: BoxError,
/// Raw response that was available
raw: R,
}
impl<R> ResponseError<R> {
/// Creates a builder for this error context type.
pub fn builder() -> builders::ResponseErrorBuilder<R> {
builders::ResponseErrorBuilder::new()
}
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:8 | &self.source
}
/// Converts this error context into the underlying error `E`
pub fn into_err(self) -> E {
self.source
}
/// Returns a reference to the raw response
pub fn raw(&self) -> &R {
&self.raw
}
/// Converts this error context into the raw response
pub fn in... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:9 | ConstructionFailure(ConstructionFailure),
/// The request failed due to a timeout. The request MAY have been sent and received.
TimeoutError(TimeoutError),
/// The request failed during dispatch. An HTTP response was not received. The request MAY
/// have been sent.
DispatchFailure(DispatchFailure... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:10 | source: source.into(),
raw,
})
}
/// Construct a `SdkError` for a service failure
pub fn service_error(source: E, raw: R) -> Self {
Self::ServiceError(ServiceError { source, raw })
}
/// Returns the underlying service error `E` if there is one
///
/// If the `Sd... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:11 | /// # }
/// ```
pub fn into_service_error(self) -> E
where
E: std::error::Error + Send + Sync + CreateUnhandledError + 'static,
R: Debug + Send + Sync + 'static,
{
match self {
Self::ServiceError(context) => context.source,
_ => E::create_unhandled_error(s... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:12 | pub fn map_service_error<E2>(self, map: impl FnOnce(E) -> E2) -> SdkError<E2, R> {
match self {
SdkError::ServiceError(context) => SdkError::<E2, R>::ServiceError(ServiceError {
source: map(context.source),
raw: context.raw,
}),
SdkError::Const... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:13 | }
}
}
impl<E, R> ProvideErrorMetadata for SdkError<E, R>
where
E: ProvideErrorMetadata,
{
fn meta(&self) -> &aws_smithy_types::Error {
match self {
SdkError::ConstructionFailure(_) => &EMPTY_ERROR_METADATA,
SdkError::TimeoutError(_) => &EMPTY_ERROR_METADATA,
SdkE... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:14 | #[derive(Debug)]
pub struct ConnectorError {
kind: ConnectorErrorKind,
source: BoxError,
connection: ConnectionStatus,
}
#[non_exhaustive]
#[derive(Debug)]
pub(crate) enum ConnectionStatus {
/// This request was never connected to the remote
///
/// This indicates the failure was during connect... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:15 | /// Construct a [`ConnectorError`] from an error caused by a timeout
///
/// Timeout errors are typically retried on a new connection.
pub fn timeout(source: BoxError) -> Self {
Self {
kind: ConnectorErrorKind::Timeout,
source,
connection: ConnectionStatus::Unknow... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:16 | /// Construct a [`ConnectorError`] from an different unclassified error.
///
/// Optionally, an explicit `Kind` may be passed.
pub fn other(source: BoxError, kind: Option<ErrorKind>) -> Self {
Self {
source,
kind: ConnectorErrorKind::Other(kind),
connection: Conne... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 601 | 657 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/result.rs:17 | /// Grants ownership of this error's source.
pub fn into_source(self) -> BoxError {
self.source
}
/// Returns metadata about the connection
///
/// If a connection was established and provided by the internal connector, a connection will
/// be returned.
pub fn connection_metadata(&... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/result.rs | Apache-2.0 | e155df8252b6a852170c1217de4b7a9b30a38aed | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/e155df8252b6a852170c1217de4b7a9b30a38aed/sdk/aws-smithy-runtime-api/src/client/result.rs | 641 | 657 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Retry handling and token bucket.
//!
//! This code defines when and how failed requests should be retried. It also defines the behavior
//! used to limit the rate that requests are sent.
pub mod cla... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/retries.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:2 | pub fn expect_delay(self) -> Duration {
match self {
ShouldAttempt::YesAfterDelay(delay) => delay,
_ => panic!("Expected this to be the `YesAfterDelay` variant but it was the `{self:?}` variant instead"),
}
}
/// If this isn't a `No` variant, panic.
pub fn expect_no(... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/retries.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:3 | &self,
context: &InterceptorContext,
runtime_components: &RuntimeComponents,
cfg: &ConfigBag,
) -> Result<ShouldAttempt, BoxError>;
}
/// A shared retry strategy.
#[derive(Clone, Debug)]
pub struct SharedRetryStrategy(Arc<dyn RetryStrategy>);
impl SharedRetryStrategy {
/// Creates a ne... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/retries.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:4 | /// A type to track the number of requests sent by the orchestrator for a given operation.
///
/// `RequestAttempts` is added to the `ConfigBag` by the orchestrator,
/// and holds the current attempt number.
#[derive(Debug, Clone, Copy)]
pub struct RequestAttempts {
attempts: u32,
}
impl RequestAttempts {
/// ... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/retries.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:5 | use super::ErrorKind;
use crate::client::interceptors::context::InterceptorContext;
use crate::client::retries::classifiers::{ClassifyRetry, RetryAction};
/// A retry classifier for testing purposes. This classifier always returns
/// `Some(RetryAction::Error(ErrorKind))` where `ErrorKind` is the value... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/aws-smithy-runtime-api/src/client/retries.rs | 161 | 181 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Retry handling and token bucket.
//!
//! This code defines when and how failed requests should be retried. It also defines the behavior
//! used to limit the rate that requests are sent.
pub mod cla... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | b95f7d686040150eb38c68d209f7a6557a565cc3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b95f7d686040150eb38c68d209f7a6557a565cc3/sdk/aws-smithy-runtime-api/src/client/retries.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:2 | pub fn expect_delay(self) -> Duration {
match self {
ShouldAttempt::YesAfterDelay(delay) => delay,
_ => panic!("Expected this to be the `YesAfterDelay` variant but it was the `{self:?}` variant instead"),
}
}
}
impl_shared_conversions!(convert SharedRetryStrategy from RetryS... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | b95f7d686040150eb38c68d209f7a6557a565cc3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b95f7d686040150eb38c68d209f7a6557a565cc3/sdk/aws-smithy-runtime-api/src/client/retries.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:3 | pub struct SharedRetryStrategy(Arc<dyn RetryStrategy>);
impl SharedRetryStrategy {
/// Creates a new [`SharedRetryStrategy`] from a retry strategy.
pub fn new(retry_strategy: impl RetryStrategy + 'static) -> Self {
Self(Arc::new(retry_strategy))
}
}
impl RetryStrategy for SharedRetryStrategy {
... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | b95f7d686040150eb38c68d209f7a6557a565cc3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b95f7d686040150eb38c68d209f7a6557a565cc3/sdk/aws-smithy-runtime-api/src/client/retries.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:4 | impl RequestAttempts {
/// Creates a new [`RequestAttempts`] with the given number of attempts.
pub fn new(attempts: u32) -> Self {
Self { attempts }
}
/// Returns the number of attempts.
pub fn attempts(&self) -> u32 {
self.attempts
}
}
impl From<u32> for RequestAttempts {
... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | b95f7d686040150eb38c68d209f7a6557a565cc3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b95f7d686040150eb38c68d209f7a6557a565cc3/sdk/aws-smithy-runtime-api/src/client/retries.rs | 121 | 172 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:5 | impl ClassifyRetry for AlwaysRetry {
fn classify_retry(&self, error: &InterceptorContext) -> RetryAction {
tracing::debug!("Retrying error {:?} as an {:?}", error, self.0);
RetryAction::retryable_error(self.0)
}
fn name(&self) -> &'static str {
"Always Retry"... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | b95f7d686040150eb38c68d209f7a6557a565cc3 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b95f7d686040150eb38c68d209f7a6557a565cc3/sdk/aws-smithy-runtime-api/src/client/retries.rs | 161 | 172 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Retry handling and token bucket.
//!
//! This code defines when and how failed requests should be retried. It also defines the behavior
//! used to limit the rate that requests are sent.
pub mod cla... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 4dfc7e900e9e41759c340162cf7b4c4019c14b3c | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/4dfc7e900e9e41759c340162cf7b4c4019c14b3c/sdk/aws-smithy-runtime-api/src/client/retries.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:2 | match self {
ShouldAttempt::YesAfterDelay(delay) => delay,
_ => panic!("Expected this to be the `YesAfterDelay` variant but it was the `{self:?}` variant instead"),
}
}
}
impl_shared_conversions!(convert SharedRetryStrategy from RetryStrategy using SharedRetryStrategy::new);
/// De... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 4dfc7e900e9e41759c340162cf7b4c4019c14b3c | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/4dfc7e900e9e41759c340162cf7b4c4019c14b3c/sdk/aws-smithy-runtime-api/src/client/retries.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:3 | impl SharedRetryStrategy {
/// Creates a new [`SharedRetryStrategy`] from a retry strategy.
pub fn new(retry_strategy: impl RetryStrategy + 'static) -> Self {
Self(Arc::new(retry_strategy))
}
}
impl RetryStrategy for SharedRetryStrategy {
fn should_attempt_initial_request(
&self,
... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 4dfc7e900e9e41759c340162cf7b4c4019c14b3c | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/4dfc7e900e9e41759c340162cf7b4c4019c14b3c/sdk/aws-smithy-runtime-api/src/client/retries.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:4 | pub fn new(attempts: u32) -> Self {
Self { attempts }
}
/// Returns the number of attempts.
pub fn attempts(&self) -> u32 {
self.attempts
}
}
impl From<u32> for RequestAttempts {
fn from(attempts: u32) -> Self {
Self::new(attempts)
}
}
impl From<RequestAttempts> for u3... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 4dfc7e900e9e41759c340162cf7b4c4019c14b3c | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/4dfc7e900e9e41759c340162cf7b4c4019c14b3c/sdk/aws-smithy-runtime-api/src/client/retries.rs | 121 | 169 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
//! Retry handling and token bucket.
//!
//! This code defines when and how failed requests should be retried. It also defines the behavior
//! used to limit the rate that requests are sent.
use crate::... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/aws-smithy-runtime-api/src/client/retries.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:2 | /// Decider for whether or not to attempt a request, and when.
///
/// The orchestrator consults the retry strategy every time before making a request.
/// This includes the initial request, and any retry attempts thereafter. The
/// orchestrator will retry indefinitely (until success) if the retry strategy
/// always ... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/aws-smithy-runtime-api/src/client/retries.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:3 | fn should_attempt_initial_request(
&self,
runtime_components: &RuntimeComponents,
cfg: &ConfigBag,
) -> Result<ShouldAttempt, BoxError> {
self.0
.should_attempt_initial_request(runtime_components, cfg)
}
fn should_attempt_retry(
&self,
context: &I... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/aws-smithy-runtime-api/src/client/retries.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:4 | }
/// Classifies an error into a [`RetryReason`].
#[derive(Clone, Debug)]
pub struct RetryClassifiers {
inner: Vec<Arc<dyn ClassifyRetry>>,
}
impl RetryClassifiers {
/// Creates a new [`RetryClassifiers`].
pub fn new() -> Self {
Self {
// It's always expected that at least one classifi... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/aws-smithy-runtime-api/src/client/retries.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:5 | None => trace!("\"{}\" classifier ignored the error", cr.name()),
};
maybe_reason
})
}
fn name(&self) -> &'static str {
"Collection of Classifiers"
}
}
/// A type to track the number of requests sent by the orchestrator for a given operation.
///
/// `RequestAttemp... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/aws-smithy-runtime-api/src/client/retries.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:6 | fn from(value: RequestAttempts) -> Self {
value.attempts()
}
}
impl Storable for RequestAttempts {
type Storer = StoreReplace<Self>;
}
#[cfg(feature = "test-util")]
mod test_util {
use super::{ClassifyRetry, ErrorKind, RetryReason};
use crate::client::interceptors::context::InterceptorContext;... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/aws-smithy-runtime-api/src/client/retries.rs | 201 | 239 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:3 | fn should_attempt_initial_request(
&self,
runtime_components: &RuntimeComponents,
cfg: &ConfigBag,
) -> Result<ShouldAttempt, BoxError> {
self.0
.should_attempt_initial_request(runtime_components, cfg)
}
fn should_attempt_retry(
&self,
context: &I... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9/sdk/aws-smithy-runtime-api/src/client/retries.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:4 | /// Classifies an error into a [`RetryReason`].
#[derive(Clone, Debug)]
pub struct RetryClassifiers {
inner: Vec<Arc<dyn ClassifyRetry>>,
}
impl RetryClassifiers {
/// Creates a new [`RetryClassifiers`].
pub fn new() -> Self {
Self {
// It's always expected that at least one classifier ... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9/sdk/aws-smithy-runtime-api/src/client/retries.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:5 | maybe_reason
})
}
fn name(&self) -> &'static str {
"Collection of Classifiers"
}
}
/// A type to track the number of requests sent by the orchestrator for a given operation.
///
/// `RequestAttempts` is added to the `ConfigBag` by the orchestrator,
/// and holds the current attempt number.... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9/sdk/aws-smithy-runtime-api/src/client/retries.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:6 | }
}
impl Storable for RequestAttempts {
type Storer = StoreReplace<Self>;
}
#[cfg(feature = "test-util")]
mod test_util {
use super::{ClassifyRetry, ErrorKind, RetryReason};
use crate::client::interceptors::context::InterceptorContext;
use tracing::trace;
/// A retry classifier for testing purpos... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/fa5105e87e62527c549dd0c0d27fec0ab0fe0aa9/sdk/aws-smithy-runtime-api/src/client/retries.rs | 201 | 236 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime-api/src/client/retries.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use crate::client::interceptors::context::InterceptorContext;
use aws_smithy_types::config_bag::ConfigBag;
use std::fmt::Debug;
use std::time::Duration;
use tracing::trace;
pub use aws_smithy_types::ret... | rust | rust | rust-source | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime-api/src/client/retries.rs | Apache-2.0 | eb5d5753cf1c50253e1e392e0010fad9319433eb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/eb5d5753cf1c50253e1e392e0010fad9319433eb/sdk/aws-smithy-runtime-api/src/client/retries.rs | 1 | 60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.