pub struct ConnectionError {
pub message: String,
pub recoverable: bool,
pub url: Option<String>,
pub auth_user: Option<String>,
pub hint: Option<String>,
}Expand description
Error information passed to the on_error handler.
Fields§
§message: StringHuman-readable error message.
recoverable: boolWhether this error is recoverable (i.e. auto-reconnect may succeed).
url: Option<String>KalamDB base URL associated with the failed connection, when known.
auth_user: Option<String>Auth user associated with the failed connection, when known.
hint: Option<String>Actionable remediation hint for the caller, when known.
Implementations§
Source§impl ConnectionError
impl ConnectionError
Sourcepub fn new(message: impl Into<String>, recoverable: bool) -> ConnectionError
pub fn new(message: impl Into<String>, recoverable: bool) -> ConnectionError
Create a new connection error.
Sourcepub fn with_url(self, url: impl Into<String>) -> ConnectionError
pub fn with_url(self, url: impl Into<String>) -> ConnectionError
Attach the connection URL when available.
Sourcepub fn with_auth_user(self, auth_user: impl Into<String>) -> ConnectionError
pub fn with_auth_user(self, auth_user: impl Into<String>) -> ConnectionError
Attach the auth user when available.
Sourcepub fn with_hint(self, hint: impl Into<String>) -> ConnectionError
pub fn with_hint(self, hint: impl Into<String>) -> ConnectionError
Attach an actionable remediation hint when available.
Trait Implementations§
Source§impl Clone for ConnectionError
impl Clone for ConnectionError
Source§fn clone(&self) -> ConnectionError
fn clone(&self) -> ConnectionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ConnectionError
impl Debug for ConnectionError
Auto Trait Implementations§
impl Freeze for ConnectionError
impl RefUnwindSafe for ConnectionError
impl Send for ConnectionError
impl Sync for ConnectionError
impl Unpin for ConnectionError
impl UnsafeUnpin for ConnectionError
impl UnwindSafe for ConnectionError
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.