#[non_exhaustive]pub struct GetFieldLevelEncryptionProfileError {
pub kind: GetFieldLevelEncryptionProfileErrorKind,
/* private fields */
}
Expand description
Error type for the GetFieldLevelEncryptionProfile
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: GetFieldLevelEncryptionProfileErrorKind
Kind of error that occurred.
Implementations§
source§impl GetFieldLevelEncryptionProfileError
impl GetFieldLevelEncryptionProfileError
sourcepub fn new(kind: GetFieldLevelEncryptionProfileErrorKind, meta: Error) -> Self
pub fn new(kind: GetFieldLevelEncryptionProfileErrorKind, meta: Error) -> Self
Creates a new GetFieldLevelEncryptionProfileError
.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the GetFieldLevelEncryptionProfileError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 6795)
6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853
pub fn parse_get_field_level_encryption_profile_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetFieldLevelEncryptionProfileOutput,
crate::error::GetFieldLevelEncryptionProfileError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::GetFieldLevelEncryptionProfileError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetFieldLevelEncryptionProfileError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::GetFieldLevelEncryptionProfileError { meta: generic, kind: crate::error::GetFieldLevelEncryptionProfileErrorKind::AccessDenied({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_denied::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(response.body().as_ref(), output).map_err(crate::error::GetFieldLevelEncryptionProfileError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoSuchFieldLevelEncryptionProfile" => crate::error::GetFieldLevelEncryptionProfileError { meta: generic, kind: crate::error::GetFieldLevelEncryptionProfileErrorKind::NoSuchFieldLevelEncryptionProfile({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_field_level_encryption_profile::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_field_level_encryption_profile_xml_err(response.body().as_ref(), output).map_err(crate::error::GetFieldLevelEncryptionProfileError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetFieldLevelEncryptionProfileError::generic(generic)
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_field_level_encryption_profile_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetFieldLevelEncryptionProfileOutput,
crate::error::GetFieldLevelEncryptionProfileError,
> {
Ok({
#[allow(unused_mut)]
let mut output =
crate::output::get_field_level_encryption_profile_output::Builder::default();
let _ = response;
output = output.set_e_tag(
crate::http_serde::deser_header_get_field_level_encryption_profile_get_field_level_encryption_profile_output_e_tag(response.headers())
.map_err(|_|crate::error::GetFieldLevelEncryptionProfileError::unhandled("Failed to parse ETag from header `ETag"))?
);
output = output.set_field_level_encryption_profile(
crate::http_serde::deser_payload_get_field_level_encryption_profile_get_field_level_encryption_profile_output_field_level_encryption_profile(response.body().as_ref())?
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetFieldLevelEncryptionProfileError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 6828)
6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830
pub fn parse_get_field_level_encryption_profile_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetFieldLevelEncryptionProfileOutput,
crate::error::GetFieldLevelEncryptionProfileError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::GetFieldLevelEncryptionProfileError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetFieldLevelEncryptionProfileError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::GetFieldLevelEncryptionProfileError { meta: generic, kind: crate::error::GetFieldLevelEncryptionProfileErrorKind::AccessDenied({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_denied::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(response.body().as_ref(), output).map_err(crate::error::GetFieldLevelEncryptionProfileError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoSuchFieldLevelEncryptionProfile" => crate::error::GetFieldLevelEncryptionProfileError { meta: generic, kind: crate::error::GetFieldLevelEncryptionProfileErrorKind::NoSuchFieldLevelEncryptionProfile({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_field_level_encryption_profile::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_field_level_encryption_profile_xml_err(response.body().as_ref(), output).map_err(crate::error::GetFieldLevelEncryptionProfileError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetFieldLevelEncryptionProfileError::generic(generic)
})
}
sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_access_denied(&self) -> bool
pub fn is_access_denied(&self) -> bool
Returns true
if the error kind is GetFieldLevelEncryptionProfileErrorKind::AccessDenied
.
sourcepub fn is_no_such_field_level_encryption_profile(&self) -> bool
pub fn is_no_such_field_level_encryption_profile(&self) -> bool
Returns true
if the error kind is GetFieldLevelEncryptionProfileErrorKind::NoSuchFieldLevelEncryptionProfile
.
Trait Implementations§
source§impl Error for GetFieldLevelEncryptionProfileError
impl Error for GetFieldLevelEncryptionProfileError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<GetFieldLevelEncryptionProfileError> for Error
impl From<GetFieldLevelEncryptionProfileError> for Error
source§fn from(err: GetFieldLevelEncryptionProfileError) -> Self
fn from(err: GetFieldLevelEncryptionProfileError) -> Self
Converts to this type from the input type.