Struct relational_types::ManyToMany[][src]

pub struct ManyToMany<T, U> { /* fields omitted */ }

A many to many relation, i.e. a T can have multiple U, and vice versa.

Implementations

impl<T, U> ManyToMany<T, U>[src]

pub fn from_forward(forward: BTreeMap<Idx<T>, IdxSet<U>>) -> Self[src]

Constructor from the forward relation.

pub fn from_relations_chain<R1, R2>(r1: &R1, r2: &R2) -> Self where
    R1: Relation<From = T>,
    R2: Relation<From = R1::To, To = U>, 
[src]

Constructor from 2 chained relations, i.e. from the relations A->B and B->C, constructs the relation A->C.

pub fn from_relations_sink<R1, R2>(r1: &R1, r2: &R2) -> Self where
    R1: Relation<From = T>,
    R2: Relation<From = U, To = R1::To>, 
[src]

Constructor from 2 relations with a common sink, i.e. from the relations A->B and C->B, constructs the relation A->C.

pub fn from_relations_source<R1, R2>(r1: &R1, r2: &R2) -> Self where
    R1: Relation<To = T>,
    R2: Relation<From = R1::From, To = U>, 
[src]

Constructor from 2 relations with a common source, i.e. from the relations B->A and B->C, constructs the relation A->C.

Trait Implementations

impl<T: Debug, U: Debug> Debug for ManyToMany<T, U>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T: Default, U: Default> Default for ManyToMany<T, U>[src]

fn default() -> ManyToMany<T, U>[src]

Returns the “default value” for a type. Read more

impl<T, U> Relation for ManyToMany<T, U>[src]

type From = T

The type of the source object

type To = U

The type of the targer object

fn get_from(&self) -> IdxSet<T>[src]

Returns the complete set of the source objects.

fn get_to(&self) -> IdxSet<U>[src]

Returns the complete set of the target objects.

fn get_corresponding_forward(&self, from: &IdxSet<T>) -> IdxSet<U>[src]

For a given set of the source objects, returns the corresponding targets objects. Read more

fn get_corresponding_backward(&self, from: &IdxSet<U>) -> IdxSet<T>[src]

For a given set of the target objects, returns the corresponding source objects. Read more

Auto Trait Implementations

impl<T, U> RefUnwindSafe for ManyToMany<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

impl<T, U> Send for ManyToMany<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for ManyToMany<T, U> where
    T: Sync,
    U: Sync

impl<T, U> Unpin for ManyToMany<T, U>

impl<T, U> UnwindSafe for ManyToMany<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.