pub struct AnyBinary;Expand description
Marker for a binary column in any of arrow’s byte-string encodings.
Accepts Binary, LargeBinary, BinaryView, or
FixedSizeBinary (of any size). They all read as
&[u8] — a FixedSizeBinary<N>’s fixed-width elements are seen here as
plain &[u8] slices (length N), not &[u8; N].
Like AnyList, this is a quiver-only logical type with no
single arrow datatype: Column<AnyBinary> accepts whichever encoding it is
handed and reads them all uniformly. It is parse-only — it implements
LogicalType (so try_from/reading work) but not
ConcreteType, so there is no from_values/Default/
schema; to build, pick a concrete encoding such as Column<Binary>.
use quiver::{AnyBinary, Column};
use quiver::arrow::array::{ArrayRef, LargeBinaryArray};
// `array` may be a Binary / LargeBinary / BinaryView:
let array: ArrayRef = Arc::new(LargeBinaryArray::from_iter_values([b"abc"]));
let column = Column::<AnyBinary>::try_from(array).unwrap();
assert_eq!(column.value(0), b"abc");This type is never instantiated — it only appears as a type parameter.
Trait Implementations§
Source§impl LogicalType for AnyBinary
impl LogicalType for AnyBinary
Source§type Typed = AnyTypedBinary
type Typed = AnyTypedBinary
The fully-downcast, validated representation of one column of this datatype.
Cheap to clone (arrow arrays are reference-counted).
Source§type Value<'a> = &'a [u8]
type Value<'a> = &'a [u8]
Zero-copy element view:
&'a str for Utf8, i64 for i64,
an iterator for List<T>, Option<…> for Option<T>.Source§type Owned = Vec<u8>
type Owned = Vec<u8>
The owned value of one element, used by the convenience constructors:
String for Utf8, Option<i64> for Option<i64>, Vec<…> for List<…>, etc.Source§fn downcast(array: &dyn Array) -> Result<Self::Typed, ColumnError>
fn downcast(array: &dyn Array) -> Result<Self::Typed, ColumnError>
Validates that
array has an acceptable datatype, then recursively
downcasts it — checking the nulls of all children along the way. Read moreSource§fn to_owned_value(value: Self::Value<'_>) -> Self::Owned
fn to_owned_value(value: Self::Value<'_>) -> Self::Owned
Converts a borrowed element value into an owned one,
e.g.
&str → String.Auto Trait Implementations§
impl Freeze for AnyBinary
impl RefUnwindSafe for AnyBinary
impl Send for AnyBinary
impl Sync for AnyBinary
impl Unpin for AnyBinary
impl UnsafeUnpin for AnyBinary
impl UnwindSafe for AnyBinary
Blanket Implementations§
impl<T> Allocation for T
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
Mutably borrows from an owned value. Read more