Skip to main content

spatialrust_arrow/
error.rs

1//! Errors for Arrow C ABI bridges.
2
3/// Result type for Arrow bridge operations.
4pub type ArrowBridgeResult<T> = Result<T, ArrowBridgeError>;
5
6/// Failures converting SpatialRust records to or from Arrow C ABI values.
7#[derive(Debug, thiserror::Error)]
8pub enum ArrowBridgeError {
9    /// Invalid configuration or unsupported layout.
10    #[error("invalid Arrow bridge configuration: {0}")]
11    InvalidConfiguration(String),
12    /// Schema / dtype mismatch between Arrow and SpatialRust.
13    #[error("Arrow schema mismatch: {0}")]
14    SchemaMismatch(String),
15    /// A required null pointer was encountered.
16    #[error("null Arrow pointer: {0}")]
17    NullPointer(String),
18    /// Wrapped core error.
19    #[error(transparent)]
20    Spatial(#[from] spatialrust_core::SpatialError),
21    /// Wrapped records error.
22    #[error(transparent)]
23    Records(#[from] spatialrust_records::RecordsError),
24}