#[non_exhaustive]pub enum BusError {
UnknownTopic(String),
Io(Error),
Serde(Error),
Backend(String),
}Expand description
Bus errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownTopic(String)
Topic does not exist (provision first — publishing into the void is a silent-error class, so it’s an error, not an auto-create).
Io(Error)
I/O failure.
Serde(Error)
Serialization failure.
Backend(String)
Backend-specific failure (network brokers).
Implementations§
Source§impl BusError
impl BusError
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Distinguish permanent config errors
from transient outages so downstream error mapping can route
them to the right HTTP status. UnknownTopic is a
misconfiguration — the topic must be provisioned via the
manifest before publishing, so a retry without operator
action cannot succeed. Serde is a wire-shape violation
from the sender — also permanent for that specific payload.
Io and Backend are transient by default (network blip,
disk temporarily full, broker restarting); reclassifying
specific-message shapes here would require pattern-matching
the underlying error, which is fragile.
Callers should use is_permanent() to decide whether to
return HTTP 400/409 (permanent, no Retry-After) or 503
(transient, with Retry-After) — see
av-harness::routes::finalize_error_response.
Trait Implementations§
Source§impl Error for BusError
impl Error for BusError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for BusError
impl !RefUnwindSafe for BusError
impl Send for BusError
impl Sync for BusError
impl Unpin for BusError
impl UnsafeUnpin for BusError
impl !UnwindSafe for BusError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more