Struct NewSpecimen

Source
pub struct NewSpecimen {
    pub user_id: i64,
    pub species_id: i32,
    pub size_baby_ratio: f32,
    pub size_adult_ratio: f32,
    pub lifespan_days_ratio: f32,
    pub catch_age: f32,
}

Fields§

§user_id: i64§species_id: i32§size_baby_ratio: f32§size_adult_ratio: f32§lifespan_days_ratio: f32§catch_age: f32

Implementations§

Source§

impl NewSpecimen

Source

pub fn generate(user_id: i64, species_id: i32) -> NewSpecimen

Trait Implementations§

Source§

impl<'insert> Insertable<table> for &'insert NewSpecimen

Source§

type Values = <(Option<Grouped<Eq<user_id, <&'insert i64 as AsExpression<<user_id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<species_id, <&'insert i32 as AsExpression<<species_id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<size_baby_ratio, <&'insert f32 as AsExpression<<size_baby_ratio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<size_adult_ratio, <&'insert f32 as AsExpression<<size_adult_ratio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<lifespan_days_ratio, <&'insert f32 as AsExpression<<lifespan_days_ratio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<catch_age, <&'insert f32 as AsExpression<<catch_age as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values

The VALUES clause to insert these records Read more
Source§

fn values( self, ) -> <(Option<Eq<user_id, &'insert i64>>, Option<Eq<species_id, &'insert i32>>, Option<Eq<size_baby_ratio, &'insert f32>>, Option<Eq<size_adult_ratio, &'insert f32>>, Option<Eq<lifespan_days_ratio, &'insert f32>>, Option<Eq<catch_age, &'insert f32>>) as Insertable<table>>::Values

Construct Self::Values Read more
Source§

fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>
where T: Table, Self: Sized,

Insert self into a given table. Read more
Source§

impl Insertable<table> for NewSpecimen

Source§

impl UndecoratedInsertRecord<table> for NewSpecimen

Auto Trait Implementations§

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
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

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

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

Source§

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>,

Source§

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