Skip to main content

AnyBinary

Struct AnyBinary 

Source
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

Source§

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]

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>

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>

Validates that array has an acceptable datatype, then recursively downcasts it — checking the nulls of all children along the way. Read more
Source§

fn is_null(typed: &Self::Typed, index: usize) -> bool

Is the value at index null?
Source§

unsafe fn is_null_unchecked(typed: &Self::Typed, index: usize) -> bool

Like is_null, but without the bounds check. Read more
Source§

fn value(typed: &Self::Typed, index: usize) -> Self::Value<'_>

The value at index. Read more
Source§

unsafe fn value_unchecked(typed: &Self::Typed, index: usize) -> Self::Value<'_>

The value at index, without the bounds check value performs. Read more
Source§

fn to_owned_value(value: Self::Value<'_>) -> Self::Owned

Converts a borrowed element value into an owned one, e.g. &strString.
Source§

const NULLABLE: bool = false

May the values at this level be null? (true only for Option<…>)
Source§

impl RefType for AnyBinary

Source§

type Ref = [u8]

The borrow target: str for Utf8, i64 for i64, etc.
Source§

fn value_ref(typed: &Self::Typed, index: usize) -> &[u8]

A reference to the value at index. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.