Struct StringTape

Source
pub struct StringTape<Offset: OffsetType = i32, A: Allocator = Global> { /* private fields */ }
Expand description

UTF-8 string view over RawTape.

Implementations§

Source§

impl<Offset: OffsetType, A: Allocator> StringTape<Offset, A>

Source

pub fn new() -> StringTape<Offset, Global>

Creates a new, empty StringTape with the global allocator.

Source

pub fn new_in(allocator: A) -> Self

Creates a new, empty StringTape with a custom allocator.

Source

pub fn with_capacity( data_capacity: usize, strings_capacity: usize, ) -> Result<StringTape<Offset, Global>, StringTapeError>

Creates a new StringTape with pre-allocated capacity using the global allocator.

Source

pub fn with_capacity_in( data_capacity: usize, strings_capacity: usize, allocator: A, ) -> Result<Self, StringTapeError>

Creates a new StringTape with pre-allocated capacity and a custom allocator.

Source

pub fn push(&mut self, s: &str) -> Result<(), StringTapeError>

Adds a string to the end of the StringTape.

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 the StringTape.

Source

pub fn is_empty(&self) -> bool

Returns true if the StringTape contains no strings.

Source

pub fn data_len(&self) -> usize

Returns the total number of bytes used by string data.

Source

pub fn capacity(&self) -> usize

Returns the number of strings currently stored (same as len()).

Source

pub fn data_capacity(&self) -> usize

Returns the number of bytes allocated for string data.

Source

pub fn clear(&mut self)

Removes all strings from the StringTape, keeping allocated capacity.

Source

pub fn truncate(&mut self, len: usize)

Shortens the StringTape, keeping the first len strings and dropping the rest.

Source

pub fn extend<I>(&mut self, iter: I) -> Result<(), StringTapeError>
where I: IntoIterator, I::Item: AsRef<str>,

Extends the StringTape with the contents of an iterator.

Source

pub fn as_raw_parts(&self) -> (*const u8, *const Offset, usize, usize)

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

Source

pub fn iter(&self) -> StringTapeIter<'_, Offset, A>

Source

pub fn allocator(&self) -> &A

Returns a reference to the allocator used by this StringTape.

Trait Implementations§

Source§

impl<Offset: OffsetType> Default for StringTape<Offset, Global>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Offset: OffsetType, A: Allocator> Drop for StringTape<Offset, A>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, Offset: OffsetType> FromIterator<&'a str> for StringTape<Offset, Global>

Source§

fn from_iter<I: IntoIterator<Item = &'a str>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<Offset: OffsetType> FromIterator<String> for StringTape<Offset, Global>

Source§

fn from_iter<I: IntoIterator<Item = String>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<Offset: OffsetType, A: Allocator> Index<usize> for StringTape<Offset, A>

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, A: Allocator> IntoIterator for &'a StringTape<Offset, A>

Source§

type Item = &'a str

The type of the elements being iterated over.
Source§

type IntoIter = StringTapeIter<'a, Offset, A>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<Offset: OffsetType + Send, A: Allocator + Send> Send for StringTape<Offset, A>

Source§

impl<Offset: OffsetType + Sync, A: Allocator + Sync> Sync for StringTape<Offset, A>

Auto Trait Implementations§

§

impl<Offset, A> Freeze for StringTape<Offset, A>
where A: Freeze,

§

impl<Offset, A> RefUnwindSafe for StringTape<Offset, A>
where A: RefUnwindSafe, Offset: RefUnwindSafe,

§

impl<Offset, A> Unpin for StringTape<Offset, A>
where A: Unpin, Offset: Unpin,

§

impl<Offset, A> UnwindSafe for StringTape<Offset, A>
where A: UnwindSafe, Offset: UnwindSafe + 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.