pub struct DuplicateResourceError { /* private fields */ }Expand description
Error thrown due to a request that illegally refers to the same resource twice (for example, trying to both create and delete the same SCRAM credential for a particular user in a single request).
§Translation notes
Error code Errors::DuplicateResource.
Implementations§
Source§impl DuplicateResourceError
impl DuplicateResourceError
Sourcepub fn with_default_message() -> Self
pub fn with_default_message() -> Self
Creates the error with the default message of Errors::DuplicateResource, as the
broker’s error code is turned into an error.
Sourcepub fn with_resource(
resource: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn with_resource( resource: impl Into<String>, message: impl Into<String>, ) -> Self
Constructor
§Arguments
resource- the (potentiallyNone) resource that was referred to twicemessage- the error’s message
Sourcepub fn resource(&self) -> Option<&str>
pub fn resource(&self) -> Option<&str>
§Returns
the (potentially None) resource that was referred to twice
Sourcepub fn with_resource_source(
resource: impl Into<String>,
message: impl Into<String>,
source: Error,
) -> Self
pub fn with_resource_source( resource: impl Into<String>, message: impl Into<String>, source: Error, ) -> Self
Constructor
§Arguments
resource- the (potentiallyNone) resource that was referred to twicemessage- the error’s messagesource- the error’s cause
Trait Implementations§
Source§impl Clone for DuplicateResourceError
impl Clone for DuplicateResourceError
Source§fn clone(&self) -> DuplicateResourceError
fn clone(&self) -> DuplicateResourceError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DuplicateResourceError
impl Debug for DuplicateResourceError
Source§impl Display for DuplicateResourceError
impl Display for DuplicateResourceError
Source§impl Error for DuplicateResourceError
impl Error for DuplicateResourceError
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()
Auto Trait Implementations§
impl Freeze for DuplicateResourceError
impl RefUnwindSafe for DuplicateResourceError
impl Send for DuplicateResourceError
impl Sync for DuplicateResourceError
impl Unpin for DuplicateResourceError
impl UnsafeUnpin for DuplicateResourceError
impl UnwindSafe for DuplicateResourceError
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