pub struct Ttl {
pub id: i32,
pub family: String,
pub key: i32,
pub value: String,
pub expire: NaiveDateTime,
}
Fields§
§id: i32
§family: String
§key: i32
§value: String
§expire: NaiveDateTime
Implementations§
source§impl Ttl
impl Ttl
pub fn find(obj: &Insert, my_key: i32, db: &Database) -> Result<Option<Ttl>>
pub fn expired(db: &Database) -> Result<Vec<Ttl>>
pub fn create( obj: &Insert, key: i32, value: String, ttl: i32, db: &Database ) -> Result<()>
pub fn bump(obj: &Insert, my_key: i32, ttl: i32, db: &Database) -> Result<()>
pub fn delete(&self, db: &Database) -> Result<()>
Trait Implementations§
source§impl<'update> AsChangeset for &'update Ttl
impl<'update> AsChangeset for &'update Ttl
§type Changeset = <(Eq<family, <&'update String as AsExpression<<family as Expression>::SqlType>>::Expression>, Eq<key, <&'update i32 as AsExpression<<key as Expression>::SqlType>>::Expression>, Eq<value, <&'update String as AsExpression<<value as Expression>::SqlType>>::Expression>, Eq<expire, <&'update NaiveDateTime as AsExpression<<expire as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
type Changeset = <(Eq<family, <&'update String as AsExpression<<family as Expression>::SqlType>>::Expression>, Eq<key, <&'update i32 as AsExpression<<key as Expression>::SqlType>>::Expression>, Eq<value, <&'update String as AsExpression<<value as Expression>::SqlType>>::Expression>, Eq<expire, <&'update NaiveDateTime as AsExpression<<expire as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
The update statement this type represents
source§fn as_changeset(self) -> Self::Changeset
fn as_changeset(self) -> Self::Changeset
Convert
self
into the actual update statement being executedsource§impl<'update> AsChangeset for Ttl
impl<'update> AsChangeset for Ttl
§type Changeset = <(Eq<family, <String as AsExpression<<family as Expression>::SqlType>>::Expression>, Eq<key, <i32 as AsExpression<<key as Expression>::SqlType>>::Expression>, Eq<value, <String as AsExpression<<value as Expression>::SqlType>>::Expression>, Eq<expire, <NaiveDateTime as AsExpression<<expire as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
type Changeset = <(Eq<family, <String as AsExpression<<family as Expression>::SqlType>>::Expression>, Eq<key, <i32 as AsExpression<<key as Expression>::SqlType>>::Expression>, Eq<value, <String as AsExpression<<value as Expression>::SqlType>>::Expression>, Eq<expire, <NaiveDateTime as AsExpression<<expire as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
The update statement this type represents
source§fn as_changeset(self) -> Self::Changeset
fn as_changeset(self) -> Self::Changeset
Convert
self
into the actual update statement being executedsource§impl<'ident> Identifiable for &'ident Ttl
impl<'ident> Identifiable for &'ident Ttl
source§impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Ttlwhere
(i32, String, i32, String, NaiveDateTime): Queryable<__ST, __DB>,
impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Ttlwhere (i32, String, i32, String, NaiveDateTime): Queryable<__ST, __DB>,
impl StructuralPartialEq for Ttl
Auto Trait Implementations§
impl RefUnwindSafe for Ttl
impl Send for Ttl
impl Sync for Ttl
impl Unpin for Ttl
impl UnwindSafe for Ttl
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more