diesel::associations

Trait HasTable

Source
pub trait HasTable {
    type Table: Table;

    // Required method
    fn table() -> Self::Table;
}
Expand description

This trait indicates that a struct is associated with a single database table.

This trait is implemented by structs which implement Identifiable, as well as database tables themselves.

Required Associated Types§

Source

type Table: Table

The table this type is associated with.

Required Methods§

Source

fn table() -> Self::Table

Returns the table this type is associated with.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: HasTable> HasTable for &T

Source§

type Table = <T as HasTable>::Table

Source§

fn table() -> Self::Table

Implementors§