pub struct ConnectorError {
pub kind: ConnectorErrorKind,
pub message: String,
pub connection_id: Option<String>,
}Expand description
Connector error with safe, bounded diagnostics.
Fields§
§kind: ConnectorErrorKindClosed error family.
message: StringBounded human-safe message (no secrets).
connection_id: Option<String>Optional connection correlation (may be absent during open failures).
Implementations§
Source§impl ConnectorError
impl ConnectorError
Sourcepub fn new(kind: ConnectorErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: ConnectorErrorKind, message: impl Into<String>) -> Self
Construct a typed error.
Sourcepub fn with_connection_id(self, id: impl Into<String>) -> Self
pub fn with_connection_id(self, id: impl Into<String>) -> Self
Attach a connection id for correlation (not a secret).
Sourcepub fn configuration_invalid(message: impl Into<String>) -> Self
pub fn configuration_invalid(message: impl Into<String>) -> Self
Configuration invalid.
Sourcepub fn terminated() -> Self
pub fn terminated() -> Self
Terminated.
Sourcepub fn connection_failed(message: impl Into<String>) -> Self
pub fn connection_failed(message: impl Into<String>) -> Self
Connection failed.
Sourcepub fn session_failed(message: impl Into<String>) -> Self
pub fn session_failed(message: impl Into<String>) -> Self
Session operation failed.
Trait Implementations§
Source§impl Clone for ConnectorError
impl Clone for ConnectorError
Source§fn clone(&self) -> ConnectorError
fn clone(&self) -> ConnectorError
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 ConnectorError
impl Debug for ConnectorError
Source§impl Display for ConnectorError
impl Display for ConnectorError
impl Eq for ConnectorError
Source§impl Error for ConnectorError
impl Error for ConnectorError
1.30.0 · 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()
Source§impl PartialEq for ConnectorError
impl PartialEq for ConnectorError
impl StructuralPartialEq for ConnectorError
Auto Trait Implementations§
impl Freeze for ConnectorError
impl RefUnwindSafe for ConnectorError
impl Send for ConnectorError
impl Sync for ConnectorError
impl Unpin for ConnectorError
impl UnsafeUnpin for ConnectorError
impl UnwindSafe for ConnectorError
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