Struct butane::Many[][src]

pub struct Many<T> where
    T: DataObject
{ /* fields omitted */ }
Expand description

Used to implement a many-to-many relationship between models.

Creates a new table with columns “owner” and “has” If type T has a many-to-many relationship with U, owner type is T::PKType, has is U::PKType. Table name is T_ManyToMany_foo where foo is the name of the Many field

Implementations

Constructs a new Many. init must be called before it can be loaded or saved (or those methods will return Error::NotInitialized). init will automatically be called when a DataObject with a Many field is loaded or saved.

Used by macro-generated code. You do not need to call this directly.

Adds a value.

Removes a value.

Returns a reference to the value. It must have already been loaded. If not, returns Error::ValueNotLoaded

Used by macro-generated code. You do not need to call this directly.

Loads the values referred to by this foreign key from the database if necessary and returns a reference to them.

Trait Implementations

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.