Struct VariantMetadata

Source
pub struct VariantMetadata<'m> {
    bytes: &'m [u8],
    header: VariantMetadataHeader,
    dict_size: usize,
    dictionary_key_start_byte: usize,
}
Expand description

Encodes the Variant Metadata, see the Variant spec file for more information

Fields§

§bytes: &'m [u8]§header: VariantMetadataHeader§dict_size: usize§dictionary_key_start_byte: usize

Implementations§

Source§

impl<'m> VariantMetadata<'m>

Source

pub const fn as_bytes(&self) -> &'m [u8]

View the raw bytes (needed by very low-level decoders)

Source

pub fn try_new(bytes: &'m [u8]) -> Result<Self, ArrowError>

Source

pub fn is_sorted(&self) -> bool

Whether the dictionary keys are sorted and unique

Source

pub fn dictionary_size(&self) -> usize

Get the dictionary size

Source

pub fn version(&self) -> u8

Source

fn get_offsets_for_key_by( &self, index: usize, ) -> Result<Range<usize>, ArrowError>

Helper method to get the offset start and end range for a key by index.

Source

pub fn get_offset_by(&self, index: usize) -> Result<usize, ArrowError>

Get a single offset by index

Source

pub fn get_field_by(&self, index: usize) -> Result<&'m str, ArrowError>

Get the key-name by index

Source

pub(crate) fn get_field_by_offset( &self, offset: Range<usize>, ) -> Result<&'m str, ArrowError>

Gets the field using an offset (Range) - helper method to keep consistent API.

Source

pub fn header(&self) -> VariantMetadataHeader

Source

pub fn offsets( &self, ) -> impl Iterator<Item = Result<Range<usize>, ArrowError>> + 'm

Get the offsets as an iterator

Source

pub fn fields( &'m self, ) -> Result<impl Iterator<Item = Result<&'m str, ArrowError>>, ArrowError>

Get all key-names as an Iterator of strings

Trait Implementations§

Source§

impl<'m> Clone for VariantMetadata<'m>

Source§

fn clone(&self) -> VariantMetadata<'m>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'m> Debug for VariantMetadata<'m>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'m> PartialEq for VariantMetadata<'m>

Source§

fn eq(&self, other: &VariantMetadata<'m>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'m> Copy for VariantMetadata<'m>

Source§

impl<'m> StructuralPartialEq for VariantMetadata<'m>

Auto Trait Implementations§

§

impl<'m> Freeze for VariantMetadata<'m>

§

impl<'m> RefUnwindSafe for VariantMetadata<'m>

§

impl<'m> Send for VariantMetadata<'m>

§

impl<'m> Sync for VariantMetadata<'m>

§

impl<'m> Unpin for VariantMetadata<'m>

§

impl<'m> UnwindSafe for VariantMetadata<'m>

Blanket Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.