[][src]Struct many_to_many::ManyToMany

pub struct ManyToMany<L: Hash + Eq + Clone, R: Hash + Eq + Clone> { /* fields omitted */ }

Implementations

impl<L: Hash + Eq + Clone, R: Hash + Eq + Clone> ManyToMany<L, R>[src]

pub fn new() -> ManyToMany<L, R>[src]

pub fn insert(&mut self, left: L, right: R) -> bool[src]

Insert a new mapping between Left and Right.

Returns whether the mapping already existed.

pub fn remove(&mut self, left: &L, right: &R) -> bool[src]

Remove an existing mapping between Left and Right.

Returns whether the mapping was removed.

pub fn get_left_keys(&self) -> Keys<'_, L, HashSet<R>>[src]

Get all Left keys.

pub fn get_right_keys(&self) -> Keys<'_, R, HashSet<L>>[src]

Get all Right keys.

pub fn get_left(&self, left: &L) -> Option<Vec<R>>[src]

Get all mappings to Right from specific Left key.

pub fn get_right(&self, right: &R) -> Option<Vec<L>>[src]

Get all mappings to Left from specific Right key.

pub fn remove_left(&mut self, left: &L) -> bool[src]

Remove all mappings from Left.

Returns whether any mappings existed.

pub fn remove_right(&mut self, right: &R) -> bool[src]

Remove all mappings from Right.

Returns whether any mappings existed.

Trait Implementations

impl<L: Debug + Hash + Eq + Clone, R: Debug + Hash + Eq + Clone> Debug for ManyToMany<L, R>[src]

impl<'de, L, R> Deserialize<'de> for ManyToMany<L, R> where
    L: Hash + Eq + Clone + Deserialize<'de>,
    R: Hash + Eq + Clone + Deserialize<'de>, 
[src]

impl<L, R> Serialize for ManyToMany<L, R> where
    L: Hash + Eq + Clone + Serialize,
    R: Hash + Eq + Clone + Serialize
[src]

Auto Trait Implementations

impl<L, R> RefUnwindSafe for ManyToMany<L, R> where
    L: RefUnwindSafe,
    R: RefUnwindSafe

impl<L, R> Send for ManyToMany<L, R> where
    L: Send,
    R: Send

impl<L, R> Sync for ManyToMany<L, R> where
    L: Sync,
    R: Sync

impl<L, R> Unpin for ManyToMany<L, R> where
    L: Unpin,
    R: Unpin

impl<L, R> UnwindSafe for ManyToMany<L, R> where
    L: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.