#[non_exhaustive]pub struct SetError {
pub error_type: SetErrorType,
pub description: Option<String>,
pub properties: Option<Vec<String>>,
pub existing_id: Option<Id>,
pub max_recipients: Option<u64>,
pub invalid_recipients: Option<Vec<String>>,
pub not_found: Option<Vec<Id>>,
pub max_size: Option<u64>,
}Expand description
A per-item error in a /set response (notCreated, notUpdated,
notDestroyed maps) (RFC 8620 §5.3).
Construct with SetError::new and chain the builder methods as needed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.error_type: SetErrorTypeThe machine-readable error type.
description: Option<String>Optional human-readable description of the error.
properties: Option<Vec<String>>Property names that caused the error (for invalidProperties).
existing_id: Option<Id>The existing object id (for alreadyExists — RFC 8621 §5.7).
max_recipients: Option<u64>Maximum recipients allowed (for tooManyRecipients — RFC 8621 §7.5).
invalid_recipients: Option<Vec<String>>Invalid recipient addresses (for invalidRecipients — RFC 8621 §7.5).
not_found: Option<Vec<Id>>Missing blob IDs (for blobNotFound — RFC 8621 §5.5).
max_size: Option<u64>Maximum message size in octets (for tooLarge on EmailSubmission — RFC 8621 §7.5).
Implementations§
Source§impl SetError
impl SetError
Sourcepub fn new(error_type: SetErrorType) -> Self
pub fn new(error_type: SetErrorType) -> Self
Construct a SetError with the given type and all optional fields None.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set the human-readable description.
Sourcepub fn with_properties<I, S>(self, props: I) -> Self
pub fn with_properties<I, S>(self, props: I) -> Self
Set the list of property names that caused the error.
Sourcepub fn with_existing_id(self, id: Id) -> Self
pub fn with_existing_id(self, id: Id) -> Self
Set the existing object id (used with alreadyExists).
Sourcepub fn with_max_recipients(self, n: u64) -> Self
pub fn with_max_recipients(self, n: u64) -> Self
Set the maximum recipients (used with tooManyRecipients — RFC 8621 §7.5).
Sourcepub fn with_invalid_recipients<I, S>(self, addrs: I) -> Self
pub fn with_invalid_recipients<I, S>(self, addrs: I) -> Self
Set the invalid recipient addresses (used with invalidRecipients — RFC 8621 §7.5).
Sourcepub fn with_not_found(self, ids: Vec<Id>) -> Self
pub fn with_not_found(self, ids: Vec<Id>) -> Self
Set the missing blob IDs (used with blobNotFound — RFC 8621 §5.5).
Sourcepub fn with_max_size(self, n: u64) -> Self
pub fn with_max_size(self, n: u64) -> Self
Set the maximum message size in octets (used with tooLarge on EmailSubmission — RFC 8621 §7.5).