pub struct Error(/* private fields */);Expand description
An error that occurred when using the QuestDB client library.
The payload lives behind a Box so Result<T, Error> stays pointer-sized
on the happy path: the optional query-side ServerInfo and the diagnostic
strings would otherwise push the struct past the clippy::result_large_err
threshold.
Implementations§
Source§impl Error
impl Error
Sourcepub fn new<S: Into<String>>(code: ErrorCode, msg: S) -> Error
pub fn new<S: Into<String>>(code: ErrorCode, msg: S) -> Error
Create an error with the given code and message.
Sourcepub fn in_doubt(&self) -> bool
pub fn in_doubt(&self) -> bool
true when the operation that produced this error is delivery-unknown
(“in doubt”): the current input may already have reached the server, so
blindly replaying it on a fresh connection can duplicate rows.
This is independent of the code: a delivery-unknown
failure typically reports ErrorCode::FailoverRetry (the connection
can be replaced), yet FailoverRetry alone does not mean the input
is safe to retry. Use in_doubt() == false together with a retryable
code to decide whether re-sending the same input is safe; when
in_doubt() is true, only replay if table-level dedup/upsert keys
make duplicates harmless.
Sourcepub fn with_qwp_ws_rejection(self, rejection: QwpWsSenderError) -> Self
pub fn with_qwp_ws_rejection(self, rejection: QwpWsSenderError) -> Self
Attach a structured QWP/WebSocket rejection to this error.
Sourcepub fn with_upgrade_reject(self, reject: UpgradeReject) -> Self
pub fn with_upgrade_reject(self, reject: UpgradeReject) -> Self
Builder: attach a query-side UpgradeReject
(HTTP 421 + X-QuestDB-Role or SERVER_INFO target mismatch) so the
host-health tracker can read the role + zone without re-parsing.
Sourcepub fn with_server_info(self, info: ServerInfo) -> Self
pub fn with_server_info(self, info: ServerInfo) -> Self
Builder: attach the full last-observed SERVER_INFO to a
RoleMismatch produced from the SERVER_INFO target-mismatch path.
Sourcepub fn qwp_ws_rejection(&self) -> Option<&QwpWsSenderError>
pub fn qwp_ws_rejection(&self) -> Option<&QwpWsSenderError>
Return the structured QWP/WebSocket rejection that made this error terminal, if one is available.
Sourcepub fn upgrade_reject(&self) -> Option<&UpgradeReject>
pub fn upgrade_reject(&self) -> Option<&UpgradeReject>
Server-advertised role + zone carried alongside a query-side error.
Some when the error originated from an HTTP 421 + X-QuestDB-Role
upgrade reject or a SERVER_INFO role / target= filter mismatch;
None for all other failure paths.
Sourcepub fn server_info(&self) -> Option<&ServerInfo>
pub fn server_info(&self) -> Option<&ServerInfo>
Full last-observed SERVER_INFO carried alongside this error. Some
only when the rejection came from the SERVER_INFO target-mismatch
path; None everywhere else. Lets callers distinguish “no endpoint
matched target=” (this is Some) from “all endpoints unreachable”
(this is None).
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
Source§impl From<Infallible> for Error
impl From<Infallible> for Error
Source§fn from(_: Infallible) -> Self
fn from(_: Infallible) -> Self
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more