#[non_exhaustive]pub enum IpcError {
Show 27 variants
Io {
context: &'static str,
source: Error,
},
Data(DataError),
UnexpectedEndOfStream {
context: &'static str,
available: usize,
expected: usize,
},
InvalidContinuation {
marker: u32,
position: usize,
},
NegativeMetadataLength {
length: i32,
position: usize,
},
TooLarge {
what: &'static str,
length: u64,
cap: u64,
},
MalformedFlatbuffer {
context: &'static str,
position: usize,
},
MissingField {
table: &'static str,
field: &'static str,
},
UnsupportedMetadataVersion {
version: i16,
},
UnsupportedEndianness {
endianness: i16,
},
UnsupportedMessageHeader {
header: u8,
name: &'static str,
},
UnexpectedMessage {
expected: &'static str,
found: &'static str,
},
EmptyStream,
UnsupportedType {
code: u8,
name: &'static str,
field: String,
},
UnsupportedTypeParameters {
family: &'static str,
field: String,
detail: String,
},
ChildCountMismatch {
field: String,
family: &'static str,
expected: usize,
actual: usize,
},
LayoutCountMismatch {
what: &'static str,
expected: usize,
actual: usize,
},
BufferOutOfBounds {
index: usize,
offset: i64,
length: i64,
body_len: usize,
},
BufferTooShort {
index: usize,
role: &'static str,
actual: usize,
required: usize,
rows: usize,
},
InvalidFieldNode {
index: usize,
length: i64,
null_count: i64,
},
RowCountMismatch {
declared: usize,
column: usize,
actual: usize,
},
UnsupportedCompression {
codec: i8,
},
UnsupportedDictionary,
NotASinglePayload {
count: usize,
},
NestingTooDeep {
depth: usize,
limit: usize,
},
MissingSchema,
SchemaMismatch {
index: usize,
},
}Expand description
A failure encoding or decoding an Arrow IPC stream.
#[non_exhaustive]: the append-only evolution rule (blueprint §3.4)
applies to error enums too.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
The underlying reader or writer failed.
Fields
Data(DataError)
An array could not be rebuilt from its decoded buffers.
UnexpectedEndOfStream
The stream ended in the middle of a message.
Fields
InvalidContinuation
The 4-byte word introducing a message was neither the continuation marker nor a plausible legacy length.
Fields
NegativeMetadataLength
The encapsulated-message header declared a negative metadata length.
TooLarge
A declared length exceeded the configured cap.
Fields
MalformedFlatbuffer
The flatbuffer metadata is structurally invalid.
Fields
MissingField
A required flatbuffer field was absent.
Fields
UnsupportedMetadataVersion
Message.version named a metadata version this decoder does not read.
UnsupportedEndianness
Schema.endianness was big-endian.
UnsupportedMessageHeader
Message.header_type named a message kind AstRS does not implement.
Fields
UnexpectedMessage
A message of the wrong kind turned up where another was required.
Fields
EmptyStream
The stream carried no schema message.
UnsupportedType
Field.type named a type outside the closed P0 set (blueprint §6.1).
Fields
UnsupportedTypeParameters
A supported type family carried an unsupported parameter — a 96-bit integer, a microsecond timestamp, a time zone.
Fields
ChildCountMismatch
A nested type declared the wrong number of children.
Fields
LayoutCountMismatch
The record batch declared fewer field nodes or buffers than the schema needs, or left some unconsumed.
Fields
BufferOutOfBounds
A Buffer entry pointed outside the message body.
Fields
BufferTooShort
A buffer was shorter than the field node’s row count requires.
Fields
InvalidFieldNode
A FieldNode declared a negative or absurd length.
Fields
RowCountMismatch
Columns of a record batch disagreed with RecordBatch.length.
Fields
UnsupportedCompression
The body carried a compression codec; AstRS negotiates compression at the route level instead (blueprint §6.4).
UnsupportedDictionary
A dictionary-encoded field or a DictionaryBatch message turned up.
NotASinglePayload
decode_payload requires exactly one
record batch.
NestingTooDeep
A type nested deeper than the codec’s recursion limit.
Both codecs recurse, so an unbounded nesting depth is a stack overflow
waiting for a hostile stream; the limit is
MAX_NESTING_DEPTH.
MissingSchema
write_ipc_stream was handed no
batches, so it has no schema to open the stream with.
SchemaMismatch
A batch’s schema differs from the one the stream opened with.
The streaming format has exactly one schema message, so every batch must match it. Use one stream per schema, or cast the batch first.
Implementations§
Source§impl IpcError
impl IpcError
Sourcepub fn io(context: &'static str, source: Error) -> Self
pub fn io(context: &'static str, source: Error) -> Self
Wraps an I/O error with the operation that produced it.
Sourcepub const fn malformed(context: &'static str, position: usize) -> Self
pub const fn malformed(context: &'static str, position: usize) -> Self
Builds an IpcError::MalformedFlatbuffer.
Sourcepub const fn missing(table: &'static str, field: &'static str) -> Self
pub const fn missing(table: &'static str, field: &'static str) -> Self
Builds an IpcError::MissingField.
Sourcepub const fn is_malformed(&self) -> bool
pub const fn is_malformed(&self) -> bool
Returns true when the error means “the input bytes are not a valid
Arrow IPC stream”, as opposed to an I/O failure or an unsupported but
well-formed feature.
Route supervisors use this to decide between retrying a leg and declaring a producer broken.
use astrs_data::ipc::IpcError;
let malformed = IpcError::malformed("reading a vtable", 12);
assert!(malformed.is_malformed());
assert!(!IpcError::UnsupportedDictionary.is_malformed());Sourcepub const fn is_unsupported(&self) -> bool
pub const fn is_unsupported(&self) -> bool
Returns true when the stream is well-formed Arrow that carries a
feature outside the AstRS 0.1.0 set (blueprint §6.1).
use astrs_data::ipc::IpcError;
assert!(IpcError::UnsupportedDictionary.is_unsupported());Trait Implementations§
Source§impl Error for IpcError
impl Error for IpcError
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()