Struct vec_strings::Strings
source · [−]pub struct Strings { /* private fields */ }Expand description
Store any string efficiently in an immutable way.
Can store at most u32::MAX strings, the accumulated length
of these strings can be at most u32::MAX.
Implementations
sourceimpl Strings
impl Strings
pub fn new() -> Self
sourcepub fn with_capacity(len: u32) -> Self
pub fn with_capacity(len: u32) -> Self
len- number of strings
pub fn len(&self) -> u32
pub fn is_empty(&self) -> bool
pub fn reserve(&mut self, strs_cnt: u32)
pub fn reserve_strs(&mut self, cnt: usize)
pub fn shrink_to_fit(&mut self)
pub fn iter(&self) -> StringsIter<'_>ⓘNotable traits for StringsIter<'a>impl<'a> Iterator for StringsIter<'a> type Item = &'a str;
pub fn get(&self, index: u32) -> Option<&str>
pub fn as_str(&self) -> &str
pub fn into_str(self) -> String
Trait Implementations
sourceimpl<'a> IntoIterator for &'a Strings
impl<'a> IntoIterator for &'a Strings
impl Eq for Strings
impl StructuralEq for Strings
impl StructuralPartialEq for Strings
Auto Trait Implementations
impl RefUnwindSafe for Strings
impl Send for Strings
impl Sync for Strings
impl Unpin for Strings
impl UnwindSafe for Strings
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more