Loading rust-runtime/aws-smithy-http-server/src/extension.rs +15 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,21 @@ impl OperationExtension { /// These are modeled errors, defined in the Smithy model. #[derive(Debug, Clone)] pub struct ModeledErrorExtension(&'static str); impl_extension_new_and_deref!(ModeledErrorExtension); impl ModeledErrorExtension { /// Creates a new `ModeledErrorExtension`. pub fn new(value: &'static str) -> ModeledErrorExtension { ModeledErrorExtension(value) } } impl Deref for ModeledErrorExtension { type Target = &'static str; fn deref(&self) -> &Self::Target { &self.0 } } /// Extension type used to store the _name_ of the [`crate::runtime_error::RuntimeError`] that /// occurred during request handling (see [`crate::runtime_error::RuntimeErrorKind::name`]). Loading rust-runtime/aws-smithy-http-server/src/macros.rs +0 −27 Original line number Diff line number Diff line Loading @@ -84,33 +84,6 @@ macro_rules! opaque_future { pub use opaque_future; /// Implements `Deref` for all `Extension` holding a `&'static, str`. macro_rules! impl_deref { ($name:ident) => { impl Deref for $name { type Target = &'static str; fn deref(&self) -> &Self::Target { &self.0 } } }; } /// Implements `new` for all `Extension` holding a `&'static, str`. macro_rules! impl_extension_new_and_deref { ($name:ident) => { impl $name { #[doc = concat!("Returns a new `", stringify!($name), "`.")] pub fn new(value: &'static str) -> $name { $name(value) } } impl_deref!($name); }; } macro_rules! convert_to_request_rejection { ($from:ty, $to:ident) => { impl From<$from> for RequestRejection { Loading Loading
rust-runtime/aws-smithy-http-server/src/extension.rs +15 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,21 @@ impl OperationExtension { /// These are modeled errors, defined in the Smithy model. #[derive(Debug, Clone)] pub struct ModeledErrorExtension(&'static str); impl_extension_new_and_deref!(ModeledErrorExtension); impl ModeledErrorExtension { /// Creates a new `ModeledErrorExtension`. pub fn new(value: &'static str) -> ModeledErrorExtension { ModeledErrorExtension(value) } } impl Deref for ModeledErrorExtension { type Target = &'static str; fn deref(&self) -> &Self::Target { &self.0 } } /// Extension type used to store the _name_ of the [`crate::runtime_error::RuntimeError`] that /// occurred during request handling (see [`crate::runtime_error::RuntimeErrorKind::name`]). Loading
rust-runtime/aws-smithy-http-server/src/macros.rs +0 −27 Original line number Diff line number Diff line Loading @@ -84,33 +84,6 @@ macro_rules! opaque_future { pub use opaque_future; /// Implements `Deref` for all `Extension` holding a `&'static, str`. macro_rules! impl_deref { ($name:ident) => { impl Deref for $name { type Target = &'static str; fn deref(&self) -> &Self::Target { &self.0 } } }; } /// Implements `new` for all `Extension` holding a `&'static, str`. macro_rules! impl_extension_new_and_deref { ($name:ident) => { impl $name { #[doc = concat!("Returns a new `", stringify!($name), "`.")] pub fn new(value: &'static str) -> $name { $name(value) } } impl_deref!($name); }; } macro_rules! convert_to_request_rejection { ($from:ty, $to:ident) => { impl From<$from> for RequestRejection { Loading