[][src]Struct cortex::models::Task

pub struct Task {
    pub id: i64,
    pub service_id: i32,
    pub corpus_id: i32,
    pub status: i32,
    pub entry: String,
}

A CorTeX task, for a given corpus-service pair

Fields

id: i64

task primary key, auto-incremented by postgresql

service_id: i32

id of the service owning this task

corpus_id: i32

id of the corpus hosting this task

status: i32

current processing status of this task

entry: String

entry path on the file system

Implementations

impl Task[src]

pub fn delete_by_entry(&self, connection: &PgConnection) -> Result<usize, Error>[src]

Delete task by entry

pub fn delete_by_service_id(
    &self,
    connection: &PgConnection
) -> Result<usize, Error>
[src]

Delete all tasks matching this task's service id

pub fn delete_by_id(&self, connection: &PgConnection) -> Result<usize, Error>[src]

Delete task by id

pub fn find(taskid: i64, connection: &PgConnection) -> Result<Task, Error>[src]

Find task by id, error if none

pub fn find_by_entry(
    entry: &str,
    connection: &PgConnection
) -> Result<Task, Error>
[src]

Find task by entry, error if none

pub fn find_by_name(
    name: &str,
    corpus: &Corpus,
    service: &Service,
    connection: &PgConnection
) -> Result<Task, Error>
[src]

Find task by name-suffix of an entry, error if none

Trait Implementations

impl<'update> AsChangeset for &'update Task[src]

type Target = table

The table which Self::Changeset will be updating

type Changeset = <(Eq<service_id, &'update i32>, Eq<corpus_id, &'update i32>, Eq<status, &'update i32>, Eq<entry, &'update String>) as AsChangeset>::Changeset

The update statement this type represents

impl<'update> AsChangeset for Task[src]

type Target = table

The table which Self::Changeset will be updating

type Changeset = <(Eq<service_id, i32>, Eq<corpus_id, i32>, Eq<status, i32>, Eq<entry, String>) as AsChangeset>::Changeset

The update statement this type represents

impl<__FK> BelongsTo<Task> for LogInfo where
    __FK: Hash + Eq,
    &'__a i64: Into<Option<&'__a __FK>>,
    &'__a Task: Identifiable<Id = &'__a __FK>, 
[src]

type ForeignKey = __FK

The foreign key of this struct

type ForeignKeyColumn = task_id

The database column representing the foreign key of the table this struct represents Read more

impl<__FK> BelongsTo<Task> for LogWarning where
    __FK: Hash + Eq,
    &'__a i64: Into<Option<&'__a __FK>>,
    &'__a Task: Identifiable<Id = &'__a __FK>, 
[src]

type ForeignKey = __FK

The foreign key of this struct

type ForeignKeyColumn = task_id

The database column representing the foreign key of the table this struct represents Read more

impl<__FK> BelongsTo<Task> for LogError where
    __FK: Hash + Eq,
    &'__a i64: Into<Option<&'__a __FK>>,
    &'__a Task: Identifiable<Id = &'__a __FK>, 
[src]

type ForeignKey = __FK

The foreign key of this struct

type ForeignKeyColumn = task_id

The database column representing the foreign key of the table this struct represents Read more

impl<__FK> BelongsTo<Task> for LogFatal where
    __FK: Hash + Eq,
    &'__a i64: Into<Option<&'__a __FK>>,
    &'__a Task: Identifiable<Id = &'__a __FK>, 
[src]

type ForeignKey = __FK

The foreign key of this struct

type ForeignKeyColumn = task_id

The database column representing the foreign key of the table this struct represents Read more

impl<__FK> BelongsTo<Task> for LogInvalid where
    __FK: Hash + Eq,
    &'__a i64: Into<Option<&'__a __FK>>,
    &'__a Task: Identifiable<Id = &'__a __FK>, 
[src]

type ForeignKey = __FK

The foreign key of this struct

type ForeignKeyColumn = task_id

The database column representing the foreign key of the table this struct represents Read more

impl Clone for Task[src]

impl CortexDeletable for Task[src]

impl Debug for Task[src]

impl Eq for Task[src]

impl HasTable for Task[src]

type Table = table

The table this type is associated with.

impl<'ident> Identifiable for &'ident Task[src]

type Id = &'ident i64

The type of this struct's identifier. Read more

impl PartialEq<Task> for Task[src]

impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Task where
    (i64, i32, i32, i32, String): Queryable<__ST, __DB>, 
[src]

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

The Rust type you'd like to map from. Read more

impl<__DB: Backend> QueryableByName<__DB> for Task where
    i64: FromSql<SqlTypeOf<id>, __DB>,
    i32: FromSql<SqlTypeOf<service_id>, __DB>,
    i32: FromSql<SqlTypeOf<corpus_id>, __DB>,
    i32: FromSql<SqlTypeOf<status>, __DB>,
    String: FromSql<SqlTypeOf<entry>, __DB>, 
[src]

impl StructuralEq for Task[src]

impl StructuralPartialEq for Task[src]

Auto Trait Implementations

impl RefUnwindSafe for Task

impl Send for Task

impl Sync for Task

impl Unpin for Task

impl UnwindSafe for Task

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T> IntoSql for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

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