Struct sn0int::db::ttl::Ttl

source ·
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

source

pub fn find(obj: &Insert, my_key: i32, db: &Database) -> Result<Option<Ttl>>

source

pub fn expired(db: &Database) -> Result<Vec<Ttl>>

source

pub fn create( obj: &Insert, key: i32, value: String, ttl: i32, db: &Database ) -> Result<()>

source

pub fn bump(obj: &Insert, my_key: i32, ttl: i32, db: &Database) -> Result<()>

source

pub fn delete(&self, db: &Database) -> Result<()>

Trait Implementations§

source§

impl<'update> AsChangeset for &'update Ttl

§

type Target = table

The table which Self::Changeset will be updating
§

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

Convert self into the actual update statement being executed
source§

impl<'update> AsChangeset for Ttl

§

type Target = table

The table which Self::Changeset will be updating
§

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

Convert self into the actual update statement being executed
source§

impl Debug for Ttl

source§

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

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

impl HasTable for Ttl

§

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 Ttl

§

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<Ttl> for Ttl

source§

fn eq(&self, other: &Ttl) -> 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, __ST> Queryable<__ST, __DB> for Ttlwhere (i32, String, i32, String, NaiveDateTime): Queryable<__ST, __DB>,

§

type Row = <(i32, String, i32, String, NaiveDateTime) as Queryable<__ST, __DB>>::Row

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

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

Construct an instance of this type
source§

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>

§

impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self>

source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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::Expressionwhere Self: AsExpression<T> + Sized,

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>>::Expressionwhere &'a Self: AsExpression<T>,

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

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
§

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

§

fn vzip(self) -> V

§

impl<G1, G2> Within<G2> for G1where G2: Contains<G1>,

§

fn is_within(&self, b: &G2) -> bool