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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more