Struct rebuilderd::models::Queued
source · pub struct Queued {
pub id: i32,
pub pkgbase_id: i32,
pub version: String,
pub required_backend: String,
pub priority: i32,
pub queued_at: NaiveDateTime,
pub worker_id: Option<i32>,
pub started_at: Option<NaiveDateTime>,
pub last_ping: Option<NaiveDateTime>,
}
Fields§
§id: i32
§pkgbase_id: i32
§version: String
§required_backend: String
§priority: i32
§queued_at: NaiveDateTime
§worker_id: Option<i32>
§started_at: Option<NaiveDateTime>
§last_ping: Option<NaiveDateTime>
Implementations§
source§impl Queued
impl Queued
pub fn get_id(my_id: i32, connection: &SqliteConnection) -> Result<Queued>
pub fn get( pkg: i32, my_version: &str, connection: &SqliteConnection ) -> Result<Option<Queued>>
pub fn pop_next( my_worker_id: i32, supported_backends: &[String], connection: &SqliteConnection ) -> Result<Option<QueueItem>>
pub fn ping_job(&mut self, connection: &SqliteConnection) -> Result<()>
pub fn delete(&self, connection: &SqliteConnection) -> Result<()>
pub fn list( limit: Option<i64>, connection: &SqliteConnection ) -> Result<Vec<Queued>>
pub fn update(&self, connection: &SqliteConnection) -> Result<()>
pub fn queue_batch( pkgbases: &[(i32, String)], required_backend: String, priority: i32, connection: &SqliteConnection ) -> Result<()>
pub fn insert_batch( queued: &[NewQueued], connection: &SqliteConnection ) -> Result<()>
pub fn drop_for_pkgbases( pkgbases: &[i32], connection: &SqliteConnection ) -> Result<()>
pub fn requeue(&self, connection: &SqliteConnection) -> Result<()>
pub fn free_stale_jobs(connection: &SqliteConnection) -> Result<()>
pub fn into_api_item(self, connection: &SqliteConnection) -> Result<QueueItem>
Trait Implementations§
source§impl<'update> AsChangeset for &'update Queued
impl<'update> AsChangeset for &'update Queued
§type Changeset = <(Eq<pkgbase_id, <&'update i32 as AsExpression<<pkgbase_id as Expression>::SqlType>>::Expression>, Eq<version, <&'update String as AsExpression<<version as Expression>::SqlType>>::Expression>, Eq<required_backend, <&'update String as AsExpression<<required_backend as Expression>::SqlType>>::Expression>, Eq<priority, <&'update i32 as AsExpression<<priority as Expression>::SqlType>>::Expression>, Eq<queued_at, <&'update NaiveDateTime as AsExpression<<queued_at as Expression>::SqlType>>::Expression>, Option<Eq<worker_id, <&'update i32 as AsExpression<<worker_id as Expression>::SqlType>>::Expression>>, Option<Eq<started_at, <&'update NaiveDateTime as AsExpression<<started_at as Expression>::SqlType>>::Expression>>, Option<Eq<last_ping, <&'update NaiveDateTime as AsExpression<<last_ping as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
type Changeset = <(Eq<pkgbase_id, <&'update i32 as AsExpression<<pkgbase_id as Expression>::SqlType>>::Expression>, Eq<version, <&'update String as AsExpression<<version as Expression>::SqlType>>::Expression>, Eq<required_backend, <&'update String as AsExpression<<required_backend as Expression>::SqlType>>::Expression>, Eq<priority, <&'update i32 as AsExpression<<priority as Expression>::SqlType>>::Expression>, Eq<queued_at, <&'update NaiveDateTime as AsExpression<<queued_at as Expression>::SqlType>>::Expression>, Option<Eq<worker_id, <&'update i32 as AsExpression<<worker_id as Expression>::SqlType>>::Expression>>, Option<Eq<started_at, <&'update NaiveDateTime as AsExpression<<started_at as Expression>::SqlType>>::Expression>>, Option<Eq<last_ping, <&'update NaiveDateTime as AsExpression<<last_ping 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 Queued
impl<'update> AsChangeset for Queued
§type Changeset = <(Eq<pkgbase_id, <i32 as AsExpression<<pkgbase_id as Expression>::SqlType>>::Expression>, Eq<version, <String as AsExpression<<version as Expression>::SqlType>>::Expression>, Eq<required_backend, <String as AsExpression<<required_backend as Expression>::SqlType>>::Expression>, Eq<priority, <i32 as AsExpression<<priority as Expression>::SqlType>>::Expression>, Eq<queued_at, <NaiveDateTime as AsExpression<<queued_at as Expression>::SqlType>>::Expression>, Option<Eq<worker_id, <i32 as AsExpression<<worker_id as Expression>::SqlType>>::Expression>>, Option<Eq<started_at, <NaiveDateTime as AsExpression<<started_at as Expression>::SqlType>>::Expression>>, Option<Eq<last_ping, <NaiveDateTime as AsExpression<<last_ping as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
type Changeset = <(Eq<pkgbase_id, <i32 as AsExpression<<pkgbase_id as Expression>::SqlType>>::Expression>, Eq<version, <String as AsExpression<<version as Expression>::SqlType>>::Expression>, Eq<required_backend, <String as AsExpression<<required_backend as Expression>::SqlType>>::Expression>, Eq<priority, <i32 as AsExpression<<priority as Expression>::SqlType>>::Expression>, Eq<queued_at, <NaiveDateTime as AsExpression<<queued_at as Expression>::SqlType>>::Expression>, Option<Eq<worker_id, <i32 as AsExpression<<worker_id as Expression>::SqlType>>::Expression>>, Option<Eq<started_at, <NaiveDateTime as AsExpression<<started_at as Expression>::SqlType>>::Expression>>, Option<Eq<last_ping, <NaiveDateTime as AsExpression<<last_ping 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 Queued
impl<'ident> Identifiable for &'ident Queued
source§impl PartialEq for Queued
impl PartialEq for Queued
source§impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Queuedwhere
(i32, i32, String, String, i32, NaiveDateTime, Option<i32>, Option<NaiveDateTime>, Option<NaiveDateTime>): Queryable<__ST, __DB>,
impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Queuedwhere
(i32, i32, String, String, i32, NaiveDateTime, Option<i32>, Option<NaiveDateTime>, Option<NaiveDateTime>): Queryable<__ST, __DB>,
impl Eq for Queued
impl StructuralEq for Queued
impl StructuralPartialEq for Queued
Auto Trait Implementations§
impl RefUnwindSafe for Queued
impl Send for Queued
impl Sync for Queued
impl Unpin for Queued
impl UnwindSafe for Queued
Blanket Implementations§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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