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§
Source§impl 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<'_> ⓘ
pub fn get(&self, index: u32) -> Option<&str>
pub fn as_str(&self) -> &str
pub fn into_str(self) -> String
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Strings
impl<'a> IntoIterator for &'a Strings
impl Eq for Strings
impl StructuralPartialEq for Strings
Auto Trait Implementations§
impl Freeze for Strings
impl RefUnwindSafe for Strings
impl Send for Strings
impl Sync for Strings
impl Unpin for Strings
impl UnwindSafe for Strings
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