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>
impl<Offset: OffsetType, A: Allocator> StringTape<Offset, A>
Sourcepub fn new() -> StringTape<Offset, Global>
pub fn new() -> StringTape<Offset, Global>
Creates a new, empty StringTape with the global allocator.
Sourcepub fn with_capacity(
data_capacity: usize,
strings_capacity: usize,
) -> Result<StringTape<Offset, Global>, StringTapeError>
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.
Sourcepub fn with_capacity_in(
data_capacity: usize,
strings_capacity: usize,
allocator: A,
) -> Result<Self, StringTapeError>
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.
Sourcepub fn push(&mut self, s: &str) -> Result<(), StringTapeError>
pub fn push(&mut self, s: &str) -> Result<(), StringTapeError>
Adds a string to the end of the StringTape.
Sourcepub fn get(&self, index: usize) -> Option<&str>
pub fn get(&self, index: usize) -> Option<&str>
Returns a reference to the string at the given index, or None if out of bounds.
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of strings currently stored (same as len()).
Sourcepub fn data_capacity(&self) -> usize
pub fn data_capacity(&self) -> usize
Returns the number of bytes allocated for string data.
Sourcepub fn truncate(&mut self, len: usize)
pub fn truncate(&mut self, len: usize)
Shortens the StringTape, keeping the first len strings and dropping the rest.
Sourcepub fn extend<I>(&mut self, iter: I) -> Result<(), StringTapeError>
pub fn extend<I>(&mut self, iter: I) -> Result<(), StringTapeError>
Extends the StringTape with the contents of an iterator.
Sourcepub fn as_raw_parts(&self) -> (*const u8, *const Offset, usize, usize)
pub fn as_raw_parts(&self) -> (*const u8, *const Offset, usize, usize)
Returns the raw parts of the StringTape for Apache Arrow compatibility.
pub fn iter(&self) -> StringTapeIter<'_, Offset, A> ⓘ
Trait Implementations§
Source§impl<Offset: OffsetType> Default for StringTape<Offset, Global>
impl<Offset: OffsetType> Default for StringTape<Offset, Global>
Source§impl<Offset: OffsetType, A: Allocator> Drop for StringTape<Offset, A>
impl<Offset: OffsetType, A: Allocator> Drop for StringTape<Offset, A>
Source§impl<'a, Offset: OffsetType> FromIterator<&'a str> for StringTape<Offset, Global>
impl<'a, Offset: OffsetType> FromIterator<&'a str> for StringTape<Offset, Global>
Source§impl<Offset: OffsetType> FromIterator<String> for StringTape<Offset, Global>
impl<Offset: OffsetType> FromIterator<String> for StringTape<Offset, Global>
Source§impl<Offset: OffsetType, A: Allocator> Index<usize> for StringTape<Offset, A>
impl<Offset: OffsetType, A: Allocator> Index<usize> for StringTape<Offset, A>
Source§impl<'a, Offset: OffsetType, A: Allocator> IntoIterator for &'a StringTape<Offset, A>
impl<'a, Offset: OffsetType, A: Allocator> IntoIterator for &'a StringTape<Offset, A>
impl<Offset: OffsetType + Send, A: Allocator + Send> Send for StringTape<Offset, A>
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>
impl<Offset, A> UnwindSafe for StringTape<Offset, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more