CharsTapeView

Struct CharsTapeView 

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

UTF-8 string view over RawTapeView.

Implementations§

Source§

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

Source

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

Creates a zero-copy CharsTapeView from raw Arrow StringArray parts.

§Safety

The caller must ensure that:

  • data contains valid UTF-8 bytes for the lifetime 'a
  • offsets contains valid offsets with appropriate length
  • All offsets are within bounds of the data slice
Source

pub fn get(&self, index: usize) -> Option<&str>

Returns a reference to the string at the given index, or None if out of bounds.

Source

pub fn len(&self) -> usize

Returns the number of strings in this view.

Source

pub fn is_empty(&self) -> bool

Returns true if the view contains no strings.

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<CharsTapeView<'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.

Source§

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

Source

pub fn into_bytes_view(self) -> BytesTapeView<'a, Offset>

Trait Implementations§

Source§

impl<'a, Offset: OffsetType> From<CharsTapeView<'a, Offset>> for BytesTapeView<'a, Offset>

Source§

fn from(chars_view: CharsTapeView<'a, Offset>) -> Self

Converts to this type from the input type.
Source§

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

Source§

type Output = str

The returned type after indexing.
Source§

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

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

impl<'a, Offset: OffsetType> TryFrom<BytesTapeView<'a, Offset>> for CharsTapeView<'a, Offset>

Source§

type Error = StringTapeError

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

fn try_from(bytes_view: BytesTapeView<'a, Offset>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'a, Offset> UnwindSafe for CharsTapeView<'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.