pub struct KmsError {
pub kind: KmsErrorKind,
pub message: String,
}Expand description
Why a cross-service KMS call failed, as KMS reports it: the KMS error
code (KmsErrorKind::code) and KMS’s message. Each consuming service
maps it onto the error its own API declares (SQS KMS.AccessDeniedException,
SNS KMSAccessDenied, S3 AccessDenied, …).
Fields§
§kind: KmsErrorKind§message: StringImplementations§
Source§impl KmsError
impl KmsError
pub fn new(kind: KmsErrorKind, message: impl Into<String>) -> Self
Sourcepub fn not_found(account_id: &str, region: &str, key_ref: &str) -> Self
pub fn not_found(account_id: &str, region: &str, key_ref: &str) -> Self
KMS’s NotFoundException for a key reference (key id, key ARN, alias
name or alias ARN) that resolves to nothing; see
kms_not_found_message.
Sourcepub fn not_configured() -> Self
pub fn not_configured() -> Self
No KMS hook is wired.
Sourcepub fn relayed_message(&self) -> String
pub fn relayed_message(&self) -> String
KMS’s message with the suffix the AWS service SDKs append when a
service relays a KMS failure in its own error (recorded from SQS
SendMessage, SNS Publish, SSM PutParameter):
<message> (Service: AWSKMS; Status Code: 400; Error Code: AccessDeniedException; Request ID: <id>; Proxy: null).
Trait Implementations§
impl Eq for KmsError
Source§impl Error for KmsError
impl Error for KmsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
impl StructuralPartialEq for KmsError
Auto Trait Implementations§
impl Forget for KmsError
impl Freeze for KmsError
impl Move for KmsError
impl RefUnwindSafe for KmsError
impl Send for KmsError
impl Sync for KmsError
impl Unpin for KmsError
impl UnsafeUnpin for KmsError
impl UnwindSafe for KmsError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.