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.
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
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Many<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Many<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more