#[non_exhaustive]pub enum HdbError {
Show 21 variants
Initialization {
source: Box<dyn Error + Sync + Send>,
},
Authentication {
source: Box<HdbError>,
},
Deserialization {
source: DeserializationError,
},
Serialization {
source: SerializationError,
},
Cesu8,
Cesu8AsBytes {
bytes: Vec<u8>,
},
ConnParams {
source: Box<dyn Error + Sync + Send>,
},
DbError {
source: ServerError,
},
Decompression {
source: DecompressError,
},
TlsInvalidDnsName {
source: InvalidDnsNameError,
},
TlsInit {
source: Box<dyn Error + Sync + Send>,
},
TlsProtocol {
source: Error,
},
Evaluation(&'static str),
ExecutionResults(ExecutionResults),
Impl(Cow<'static, str>),
Poison,
SessionClosingTransactionError,
Io {
source: Error,
},
ErrorAfterReconnect {
source: Error,
second: Box<HdbError>,
},
Usage(Cow<'static, str>),
ConnectionBroken {
source: Option<Box<HdbError>>,
},
}Expand description
A list specifying categories of HdbError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Initialization
Initialization without TLS failed.
Authentication
Authentication failed.
Deserialization
Deserialization of a ResultSet, a Row, a single HdbValue,
or an OutputParameter failed (methods try_into()).
Fields
source: DeserializationErrorThe causing Error.
Serialization
Serialization of a ParameterDescriptor or a ParameterRow failed.
Fields
source: SerializationErrorThe causing Error.
Cesu8
Some error occured while decoding CESU-8. This indicates a server issue!
Cesu8AsBytes
Decoding CESU-8 failed, original bytes are available.
ConnParams
Erroneous Connection Parameters, e.g. from a malformed connection URL.
DbError
Database server responded with an error;
the contained ServerError describes the conrete reason.
Fields
source: ServerErrorThe causing Error.
Decompression
Decompression
Fields
source: DecompressErrorThe causing Error.
TlsInvalidDnsName
TLS set up failed because the server name was not valid.
Fields
source: InvalidDnsNameErrorThe causing Error.
TlsInit
TLS initialization error
TlsProtocol
TLS protocol error.
Evaluation(&'static str)
Error occured while evaluating an HdbResponse or an HdbReturnValue.
ExecutionResults(ExecutionResults)
Database server responded with at least one error.
Impl(Cow<'static, str>)
Implementation error.
Poison
Error occured in thread synchronization.
SessionClosingTransactionError
An error occurred on the server that requires the session to be terminated.
Io
Error occured in communication with the database.
ErrorAfterReconnect
Error occured
Usage(Cow<'static, str>)
Error caused by wrong usage.
ConnectionBroken
Connection is dead
Implementations§
Source§impl HdbError
impl HdbError
Sourcepub fn server_error(&self) -> Option<&ServerError>
pub fn server_error(&self) -> Option<&ServerError>
Returns the contained ServerError, if any.
This method helps in case you need programmatic access to e.g. the error code.
Example:
if let Err(hdberror) = hdb_result {
if let Some(server_error) = hdberror.server_error() {
let sys_m_error_code: (i32, String, String) = connection
.query(&format!(
"select * from SYS.M_ERROR_CODES where code = {}",
server_error.code()
))?.try_into()?;
println!("sys_m_error_code: {:?}", sys_m_error_code);
}
}Sourcepub fn display_with_inner(&self) -> String
pub fn display_with_inner(&self) -> String
Returns a decently formed and hopefully helpful error description.
Trait Implementations§
Source§impl Error for HdbError
impl Error for HdbError
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
Source§impl From<DecompressError> for HdbError
impl From<DecompressError> for HdbError
Source§fn from(source: DecompressError) -> HdbError
fn from(source: DecompressError) -> HdbError
Source§impl From<DeserializationError> for HdbError
impl From<DeserializationError> for HdbError
Source§fn from(source: DeserializationError) -> HdbError
fn from(source: DeserializationError) -> HdbError
Source§impl From<HdbError> for DeserializationError
impl From<HdbError> for DeserializationError
Source§fn from(e: HdbError) -> DeserializationError
fn from(e: HdbError) -> DeserializationError
Source§impl From<InvalidDnsNameError> for HdbError
impl From<InvalidDnsNameError> for HdbError
Source§fn from(source: InvalidDnsNameError) -> HdbError
fn from(source: InvalidDnsNameError) -> HdbError
Source§impl From<SerializationError> for HdbError
impl From<SerializationError> for HdbError
Source§fn from(source: SerializationError) -> HdbError
fn from(source: SerializationError) -> HdbError
Source§impl From<ServerError> for HdbError
impl From<ServerError> for HdbError
Source§fn from(source: ServerError) -> HdbError
fn from(source: ServerError) -> HdbError
Auto Trait Implementations§
impl Freeze for HdbError
impl !RefUnwindSafe for HdbError
impl Send for HdbError
impl Sync for HdbError
impl Unpin for HdbError
impl !UnwindSafe for HdbError
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
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> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);