pub struct DoubleMap { /* private fields */ }Expand description
A bidirectional map between two string key spaces.
Implementations§
Source§impl DoubleMap
impl DoubleMap
pub fn new() -> Self
pub fn insert(&mut self, key: &str, value: &str) -> bool
pub fn get_forward(&self, key: &str) -> Option<&str>
pub fn get_backward(&self, value: &str) -> Option<&str>
pub fn remove_by_key(&mut self, key: &str) -> bool
pub fn remove_by_value(&mut self, value: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
pub fn contains_value(&self, value: &str) -> bool
pub fn count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn keys(&self) -> Vec<&str>
pub fn values(&self) -> Vec<&str>
pub fn clear(&mut self)
pub fn to_pairs(&self) -> Vec<(&str, &str)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DoubleMap
impl RefUnwindSafe for DoubleMap
impl Send for DoubleMap
impl Sync for DoubleMap
impl Unpin for DoubleMap
impl UnsafeUnpin for DoubleMap
impl UnwindSafe for DoubleMap
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