pub struct DuplicateResourceError { /* private fields */ }Expand description
A request illegally referred to the same resource twice.
Corresponds to Java’s DuplicateResourceException, error code Errors::DuplicateResource.
Java extends chain:
DuplicateResourceException -> ApiException -> KafkaException
Hand-written rather than declared with kafka_error_type! because it
carries Java’s resource field and resource() accessor.
Implementations§
Source§impl DuplicateResourceError
impl DuplicateResourceError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Create the error with the given message and no resource — Java’s
DuplicateResourceException(String message).
The three translated constructors intersect on {message}, which is
exactly this one — so it keeps the plain name and the other two are
suffixed with their parameters beyond the intersection (CLAUDE.md §2).
Sourcepub fn with_default_message() -> Self
pub fn with_default_message() -> Self
Create the error with the code’s default message — used by
Errors::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
Create the error naming the offending resource — Java’s
DuplicateResourceException(String resource, String message).
Suffixed per new.
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
Create the error with a resource, message, and underlying cause,
mirroring Java’s DuplicateResourceException(String resource, String message, Throwable cause).
Suffixed per new.
Trait Implementations§
Source§impl Clone for DuplicateResourceError
impl Clone for DuplicateResourceError
Source§fn clone(&self) -> DuplicateResourceError
fn clone(&self) -> DuplicateResourceError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more