Struct relations::model::Book

source ·
pub struct Book {
    pub id: i32,
    pub title: String,
}

Fields§

§id: i32§title: String

Trait Implementations§

source§

impl<__FK> BelongsTo<&Book> for BookAuthor
where __FK: Hash + Eq, for<'__a> &'__a i32: Into<Option<&'__a __FK>>, for<'__a> &'__a Book: Identifiable<Id = &'__a __FK>,

§

type ForeignKey = __FK

The foreign key of this struct
§

type ForeignKeyColumn = book_id

The database column representing the foreign key of the table this struct represents
source§

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self
source§

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table
source§

impl<__FK> BelongsTo<&Book> for Page
where __FK: Hash + Eq, for<'__a> &'__a i32: Into<Option<&'__a __FK>>, for<'__a> &'__a Book: Identifiable<Id = &'__a __FK>,

§

type ForeignKey = __FK

The foreign key of this struct
§

type ForeignKeyColumn = book_id

The database column representing the foreign key of the table this struct represents
source§

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self
source§

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table
source§

impl<__FK> BelongsTo<Book> for BookAuthor
where __FK: Hash + Eq, for<'__a> &'__a i32: Into<Option<&'__a __FK>>, for<'__a> &'__a Book: Identifiable<Id = &'__a __FK>,

§

type ForeignKey = __FK

The foreign key of this struct
§

type ForeignKeyColumn = book_id

The database column representing the foreign key of the table this struct represents
source§

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self
source§

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table
source§

impl<__FK> BelongsTo<Book> for Page
where __FK: Hash + Eq, for<'__a> &'__a i32: Into<Option<&'__a __FK>>, for<'__a> &'__a Book: Identifiable<Id = &'__a __FK>,

§

type ForeignKey = __FK

The foreign key of this struct
§

type ForeignKeyColumn = book_id

The database column representing the foreign key of the table this struct represents
source§

fn foreign_key(&self) -> Option<&Self::ForeignKey>

Returns the foreign key for self
source§

fn foreign_key_column() -> Self::ForeignKeyColumn

Returns the foreign key column of this struct’s table
source§

impl Clone for Book

source§

fn clone(&self) -> Book

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Book

source§

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

Formats the value using the given formatter. Read more
source§

impl HasTable for Book

§

type Table = table

The table this type is associated with.
source§

fn table() -> Self::Table

Returns the table this type is associated with.
source§

impl<'ident> Identifiable for &'ident Book

§

type Id = &'ident i32

The type of this struct’s identifier. Read more
source§

fn id(self) -> Self::Id

Returns the identifier for this record. Read more
source§

impl PartialEq for Book

source§

fn eq(&self, other: &Book) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<__DB: Backend, __ST0, __ST1> Queryable<(__ST0, __ST1), __DB> for Book

§

type Row = (i32, String)

The Rust type you’d like to map from. Read more
source§

fn build(row: Self::Row) -> Result<Self>

Construct an instance of this type
source§

impl<__DB: Backend> Selectable<__DB> for Book

§

type SelectExpression = (id, title)

The expression you’d like to select. Read more
source§

fn construct_selection() -> Self::SelectExpression

Construct an instance of the expression
source§

impl StructuralPartialEq for Book

Auto Trait Implementations§

§

impl Freeze for Book

§

impl RefUnwindSafe for Book

§

impl Send for Book

§

impl Sync for Book

§

impl Unpin for Book

§

impl UnwindSafe for Book

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression

Convert &self to an expression for Diesel’s query builder. Read more
source§

impl<T, DB> SelectableHelper<DB> for T
where T: Selectable<DB>, DB: Backend,

source§

fn as_select() -> SelectBy<T, DB>

Construct a select clause based on a Selectable implementation. Read more
source§

fn as_returning() -> SelectBy<Self, DB>

An alias for as_select that can be used with returning clauses
source§

impl<T, ST, DB> StaticallySizedRow<ST, DB> for T
where ST: SqlTypeOrSelectable + TupleSize, T: Queryable<ST, DB>, DB: Backend,

source§

const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE

The number of fields that this type will consume.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V