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

source

pub fn get_id(my_id: i32, connection: &SqliteConnection) -> Result<Queued>

source

pub fn get( pkg: i32, my_version: &str, connection: &SqliteConnection ) -> Result<Option<Queued>>

source

pub fn pop_next( my_worker_id: i32, supported_backends: &[String], connection: &SqliteConnection ) -> Result<Option<QueueItem>>

source

pub fn ping_job(&mut self, connection: &SqliteConnection) -> Result<()>

source

pub fn delete(&self, connection: &SqliteConnection) -> Result<()>

source

pub fn list( limit: Option<i64>, connection: &SqliteConnection ) -> Result<Vec<Queued>>

source

pub fn update(&self, connection: &SqliteConnection) -> Result<()>

source

pub fn queue_batch( pkgbases: &[(i32, String)], required_backend: String, priority: i32, connection: &SqliteConnection ) -> Result<()>

source

pub fn insert_batch( queued: &[NewQueued], connection: &SqliteConnection ) -> Result<()>

source

pub fn drop_for_pkgbases( pkgbases: &[i32], connection: &SqliteConnection ) -> Result<()>

source

pub fn requeue(&self, connection: &SqliteConnection) -> Result<()>

source

pub fn free_stale_jobs(connection: &SqliteConnection) -> Result<()>

source

pub fn into_api_item(self, connection: &SqliteConnection) -> Result<QueueItem>

Trait Implementations§

source§

impl<'update> AsChangeset for &'update Queued

§

type Target = table

The table which Self::Changeset will be updating
§

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

Convert self into the actual update statement being executed
source§

impl<'update> AsChangeset for Queued

source§

impl Debug for Queued

source§

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

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

impl HasTable for Queued

§

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 Queued

§

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 Queued

source§

fn eq(&self, other: &Queued) -> 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 Queued

§

type Row = <(i32, i32, String, String, i32, NaiveDateTime, Option<i32>, Option<NaiveDateTime>, Option<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 Serialize for Queued

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Queued

source§

impl StructuralEq for Queued

source§

impl StructuralPartialEq for Queued

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
where 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>>::Expression

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

impl<T> Same for T

§

type Output = T

Should always be Self
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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more