RawTapeView

Struct RawTapeView 

Source
pub struct RawTapeView<'a, Offset: OffsetType> { /* private fields */ }
Expand description

Zero-copy read-only view into a RawTape slice.

Implementations§

Source§

impl<'a, Offset: OffsetType> RawTapeView<'a, Offset>

Source

pub unsafe fn from_raw_parts(data: &'a [u8], offsets: &'a [Offset]) -> Self

Creates a zero-copy view from raw Arrow-compatible parts.

§Safety

The caller must ensure that:

  • data contains valid bytes for the lifetime 'a
  • offsets contains valid offsets with length items_count + 1
  • All offsets are within bounds of the data slice
  • For CharsTapeView, data must be valid UTF-8
Source

pub fn get(&self, index: usize) -> Option<&[u8]>

Returns a reference to the bytes at the given index within this view.

Source

pub fn len(&self) -> usize

Returns the number of items in this view.

Source

pub fn is_empty(&self) -> bool

Returns true if the view contains no items.

Source

pub fn data_len(&self) -> usize

Returns the total number of bytes in this view.

Source

pub fn subview( &self, start: usize, end: usize, ) -> Result<RawTapeView<'a, Offset>, StringTapeError>

Creates a sub-view of this view

Source

pub fn as_raw_parts(&self) -> RawParts<Offset>

Returns the raw parts of the view for Apache Arrow compatibility.

Trait Implementations§

Source§

impl<'a, Offset: OffsetType> Index<Range<usize>> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, range: Range<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, Offset: OffsetType> Index<RangeFrom<usize>> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, range: RangeFrom<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, Offset: OffsetType> Index<RangeFull> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, _range: RangeFull) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, Offset: OffsetType> Index<RangeInclusive<usize>> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, range: RangeInclusive<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, Offset: OffsetType> Index<RangeTo<usize>> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, range: RangeTo<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, Offset: OffsetType> Index<RangeToInclusive<usize>> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, range: RangeToInclusive<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, Offset: OffsetType> Index<usize> for RawTapeView<'a, Offset>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'a, Offset> Freeze for RawTapeView<'a, Offset>

§

impl<'a, Offset> RefUnwindSafe for RawTapeView<'a, Offset>
where Offset: RefUnwindSafe,

§

impl<'a, Offset> Send for RawTapeView<'a, Offset>
where Offset: Sync,

§

impl<'a, Offset> Sync for RawTapeView<'a, Offset>
where Offset: Sync,

§

impl<'a, Offset> Unpin for RawTapeView<'a, Offset>

§

impl<'a, Offset> UnwindSafe for RawTapeView<'a, Offset>
where Offset: RefUnwindSafe,

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> 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, 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.