pub struct ArrowConversionError { /* private fields */ }Expand description
Root error type for hdbconnect-arrow crate.
This error type captures all possible failure modes during HANA to Arrow
conversion. Exposes predicate methods (is_xxx()) for error classification
without exposing internals.
§Example
use hdbconnect_arrow::ArrowConversionError;
fn handle_error(err: ArrowConversionError) {
if err.is_unsupported_type() {
eprintln!("Unsupported HANA type encountered");
} else if err.is_schema_mismatch() {
eprintln!("Schema mismatch detected");
}
}Implementations§
Source§impl ArrowConversionError
impl ArrowConversionError
Sourcepub const fn unsupported_type(type_id: i16) -> Self
pub const fn unsupported_type(type_id: i16) -> Self
Create error for unsupported HANA type.
Sourcepub const fn schema_mismatch(expected: usize, actual: usize) -> Self
pub const fn schema_mismatch(expected: usize, actual: usize) -> Self
Create error for schema mismatch.
Sourcepub fn value_conversion(
column: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn value_conversion( column: impl Into<String>, message: impl Into<String>, ) -> Self
Create error for value conversion failure.
Sourcepub fn value_conversion_with_source<E>(
column: impl Into<String>,
message: impl Into<String>,
source: E,
) -> Self
pub fn value_conversion_with_source<E>( column: impl Into<String>, message: impl Into<String>, source: E, ) -> Self
Create error for value conversion failure with source error.
Sourcepub const fn decimal_overflow(precision: u8, scale: i8) -> Self
pub const fn decimal_overflow(precision: u8, scale: i8) -> Self
Create error for decimal overflow.
Sourcepub fn lob_streaming(message: impl Into<String>) -> Self
pub fn lob_streaming(message: impl Into<String>) -> Self
Create error for LOB streaming failure.
Sourcepub fn invalid_precision(message: impl Into<String>) -> Self
pub fn invalid_precision(message: impl Into<String>) -> Self
Create error for invalid precision.
Sourcepub fn invalid_scale(message: impl Into<String>) -> Self
pub fn invalid_scale(message: impl Into<String>) -> Self
Create error for invalid scale.
Sourcepub const fn is_unsupported_type(&self) -> bool
pub const fn is_unsupported_type(&self) -> bool
Returns true if this is an unsupported type error.
Sourcepub const fn is_schema_mismatch(&self) -> bool
pub const fn is_schema_mismatch(&self) -> bool
Returns true if this is a schema mismatch error.
Sourcepub const fn is_value_conversion(&self) -> bool
pub const fn is_value_conversion(&self) -> bool
Returns true if this is a value conversion error.
Sourcepub const fn is_decimal_overflow(&self) -> bool
pub const fn is_decimal_overflow(&self) -> bool
Returns true if this is a decimal overflow error.
Sourcepub const fn is_arrow_error(&self) -> bool
pub const fn is_arrow_error(&self) -> bool
Returns true if this is an Arrow library error.
Sourcepub const fn is_hdbconnect_error(&self) -> bool
pub const fn is_hdbconnect_error(&self) -> bool
Returns true if this is an hdbconnect error.
Sourcepub const fn is_lob_streaming(&self) -> bool
pub const fn is_lob_streaming(&self) -> bool
Returns true if this is a LOB streaming error.
Sourcepub const fn is_invalid_precision(&self) -> bool
pub const fn is_invalid_precision(&self) -> bool
Returns true if this is an invalid precision error.
Sourcepub const fn is_invalid_scale(&self) -> bool
pub const fn is_invalid_scale(&self) -> bool
Returns true if this is an invalid scale error.
Sourcepub const fn is_recoverable(&self) -> bool
pub const fn is_recoverable(&self) -> bool
Returns true if this error is potentially recoverable.
Recoverable errors are typically transient issues that might succeed if retried (e.g., network timeouts, temporary failures).
Non-recoverable errors indicate permanent failures like schema mismatches, unsupported types, or data corruption.
§Example
fn process_with_retry<T>(f: impl Fn() -> Result<T>) -> Result<T> {
for _ in 0..3 {
match f() {
Ok(v) => return Ok(v),
Err(e) if e.is_recoverable() => continue,
Err(e) => return Err(e),
}
}
f() // Final attempt
}Sourcepub const fn is_configuration_error(&self) -> bool
pub const fn is_configuration_error(&self) -> bool
Returns true if this error is a configuration error.
Configuration errors indicate incorrect setup that won’t be fixed by retrying.
Sourcepub const fn is_data_error(&self) -> bool
pub const fn is_data_error(&self) -> bool
Returns true if this error is a data error.
Data errors indicate issues with the data being processed.