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>
impl<'a, Offset: OffsetType> CharsTapeView<'a, Offset>
Sourcepub unsafe fn from_raw_parts(data: &'a [u8], offsets: &'a [Offset]) -> Self
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
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 subview(
&self,
start: usize,
end: usize,
) -> Result<CharsTapeView<'a, Offset>, StringTapeError>
pub fn subview( &self, start: usize, end: usize, ) -> Result<CharsTapeView<'a, Offset>, StringTapeError>
Creates a sub-view of this view
Sourcepub fn as_raw_parts(&self) -> RawParts<Offset>
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>
impl<'a, Offset: OffsetType> CharsTapeView<'a, Offset>
pub fn into_bytes_view(self) -> BytesTapeView<'a, Offset>
Trait Implementations§
Source§impl<'a, Offset: OffsetType> From<CharsTapeView<'a, Offset>> for BytesTapeView<'a, Offset>
impl<'a, Offset: OffsetType> From<CharsTapeView<'a, Offset>> for BytesTapeView<'a, Offset>
Source§fn from(chars_view: CharsTapeView<'a, Offset>) -> Self
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>
impl<'a, Offset: OffsetType> Index<usize> for CharsTapeView<'a, Offset>
Source§impl<'a, Offset: OffsetType> TryFrom<BytesTapeView<'a, Offset>> for CharsTapeView<'a, Offset>
impl<'a, Offset: OffsetType> TryFrom<BytesTapeView<'a, Offset>> for CharsTapeView<'a, Offset>
Source§type Error = StringTapeError
type Error = StringTapeError
The type returned in the event of a conversion error.
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> 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