Struct relational_types::OneToMany[][src]

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

A one to many relation, i.e. to one T corresponds many U, and a U has one corresponding T.

Implementations

impl<T, U> OneToMany<T, U> where
    T: Id<T>,
    U: Id<U> + Id<T>, 
[src]

pub fn new(
    one: &CollectionWithId<T>,
    many: &CollectionWithId<U>,
    rel_name: &str
) -> Result<Self, Error>
[src]

Construct the relation automatically from the 2 given CollectionWithIds.

Trait Implementations

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

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

Formats the value using the given formatter. Read more

impl<T, U> Default for OneToMany<T, U>[src]

fn default() -> Self[src]

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

impl<T, U> Relation for OneToMany<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 OneToMany<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

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

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

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

impl<T, U> UnwindSafe for OneToMany<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.