pub struct Utf8Container<S: Storage = Cow> { /* private fields */ }Implementations§
Source§impl Utf8Container<Cow>
impl Utf8Container<Cow>
pub fn new(data: Vec<String>) -> Self
pub fn from_vec(data: Vec<String>) -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn from_raw_parts(data: Vec<String>) -> Self
pub fn from_raw_parts(data: Vec<String>) -> Self
Reconstruct from a Vec of owned Strings (for compatibility with
previous from_raw_parts(Vec<String>)).
Sourcepub fn from_bytes_offsets(data: Vec<u8>, offsets: Vec<u64>) -> Self
pub fn from_bytes_offsets(data: Vec<u8>, offsets: Vec<u64>) -> Self
Build directly from contiguous bytes + offsets (zero-copy from the caller’s perspective). Caller must ensure the bytes are valid UTF-8 and offsets are well-formed.
Sourcepub fn try_into_raw_parts(self) -> Option<Vec<String>>
pub fn try_into_raw_parts(self) -> Option<Vec<String>>
Try to decompose into a Vec<String> for compatibility with code
paths that need owned strings. Always succeeds (allocates).
Source§impl<S: Storage> Utf8Container<S>
impl<S: Storage> Utf8Container<S>
pub fn from_inner(inner: VarlenContainer<S>) -> Self
Sourcepub fn from_storage_parts(data: S::Vec<u8>, offsets: S::Vec<u64>) -> Self
pub fn from_storage_parts(data: S::Vec<u8>, offsets: S::Vec<u64>) -> Self
Construct from storage-generic data+offsets vectors. Used by arena conversion. Caller must ensure data is valid UTF-8 and offsets are well-formed (length >= 1, [0] == 0, monotonic non-decreasing, last <= data.len()).
Sourcepub fn data_storage(&self) -> &S::Vec<u8>
pub fn data_storage(&self) -> &S::Vec<u8>
Borrow the inner data + offsets vectors.
pub fn offsets_storage(&self) -> &S::Vec<u64>
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get(&self, index: usize) -> Option<&str>
pub fn get(&self, index: usize) -> Option<&str>
Borrow the i-th string. UTF-8 validity is guaranteed by construction.
pub fn is_defined(&self, idx: usize) -> bool
pub fn is_fully_defined(&self) -> bool
Sourcepub fn data_bytes(&self) -> &[u8] ⓘ
pub fn data_bytes(&self) -> &[u8] ⓘ
Borrow the underlying concatenated payload bytes. Used by the FFI marshal path for zero-copy borrow.
Sourcepub fn inner(&self) -> &VarlenContainer<S>
pub fn inner(&self) -> &VarlenContainer<S>
Borrow the underlying VarlenContainer (test/debug only).
pub fn as_string(&self, index: usize) -> String
pub fn get_value(&self, index: usize) -> Value
Source§impl Utf8Container<Cow>
impl Utf8Container<Cow>
pub fn push(&mut self, value: String)
pub fn push_str(&mut self, value: &str)
pub fn push_default(&mut self)
pub fn extend(&mut self, other: &Self) -> Result<()>
pub fn slice(&self, start: usize, end: usize) -> Self
pub fn filter(&mut self, mask: &<Cow as Storage>::BitVec)
pub fn reorder(&mut self, indices: &[usize])
pub fn take(&self, num: usize) -> Self
Trait Implementations§
Source§impl<S: Storage> Clone for Utf8Container<S>
impl<S: Storage> Clone for Utf8Container<S>
Source§impl<S: Storage> Debug for Utf8Container<S>where
VarlenContainer<S>: Debug,
impl<S: Storage> Debug for Utf8Container<S>where
VarlenContainer<S>: Debug,
Source§impl Default for Utf8Container<Cow>
impl Default for Utf8Container<Cow>
Source§impl<'de> Deserialize<'de> for Utf8Container<Cow>
impl<'de> Deserialize<'de> for Utf8Container<Cow>
Source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> StdResult<Self, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> StdResult<Self, D::Error>
Source§impl<S: Storage> PartialEq for Utf8Container<S>where
VarlenContainer<S>: PartialEq,
impl<S: Storage> PartialEq for Utf8Container<S>where
VarlenContainer<S>: PartialEq,
Auto Trait Implementations§
impl<S> Freeze for Utf8Container<S>
impl<S> RefUnwindSafe for Utf8Container<S>
impl<S> Send for Utf8Container<S>
impl<S> Sync for Utf8Container<S>
impl<S> Unpin for Utf8Container<S>
impl<S> UnsafeUnpin for Utf8Container<S>
impl<S> UnwindSafe for Utf8Container<S>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more