pub struct StringSet { /* private fields */ }Expand description
An ordered set of owned strings.
Implementations§
Source§impl StringSet
impl StringSet
pub fn new() -> Self
pub fn insert(&mut self, s: &str) -> bool
pub fn remove(&mut self, s: &str) -> bool
pub fn contains(&self, s: &str) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn to_vec(&self) -> Vec<String>
pub fn clear(&mut self)
Sourcepub fn intersection(&self, other: &StringSet) -> StringSet
pub fn intersection(&self, other: &StringSet) -> StringSet
Returns elements present in both sets.
Sourcepub fn difference(&self, other: &StringSet) -> StringSet
pub fn difference(&self, other: &StringSet) -> StringSet
Returns elements in self but not in other.
pub fn add_count(&self) -> u64
pub fn remove_count(&self) -> u64
pub fn starts_with_prefix(&self, prefix: &str) -> Vec<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StringSet
impl RefUnwindSafe for StringSet
impl Send for StringSet
impl Sync for StringSet
impl Unpin for StringSet
impl UnsafeUnpin for StringSet
impl UnwindSafe for StringSet
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