[][src]Struct cortex::backend::Backend

pub struct Backend {
    pub connection: PgConnection,
}

Provides an interface to the Postgres task store

Fields

connection: PgConnection

The Diesel PgConnection object

Implementations

impl Backend[src]

Instance methods

pub fn mark_imported(&self, imported_tasks: &[NewTask]) -> Result<usize, Error>[src]

Insert a vector of new NewTask tasks into the Task store For example, on import, or when a new service is activated on a corpus

pub fn mark_done(&self, reports: &[TaskReport]) -> Result<(), Error>[src]

Insert a vector of TaskReport reports into the Task store, also marking their tasks as completed with the correct status code.

pub fn mark_rerun(&self, options: RerunOptions) -> Result<(), Error>[src]

Given a complex selector, of a Corpus, Service, and the optional severity, category and what mark all matching tasks to be rerun

pub fn mark_new_run(
    &self,
    corpus: &Corpus,
    service: &Service,
    owner: String,
    description: String
) -> Result<(), Error>
[src]

While not changing any status information for Tasks, add a new historical run bookmark

pub fn delete<Model: CortexDeletable>(
    &self,
    object: &Model
) -> Result<usize, Error>
[src]

Generic delete method, uses primary "id" field

pub fn delete_by<Model: CortexDeletable>(
    &self,
    object: &Model,
    field: &str
) -> Result<usize, Error>
[src]

Delete all entries matching the "field" value of a given object

pub fn add<Model: CortexInsertable>(
    &self,
    object: &Model
) -> Result<usize, Error>
[src]

Generic addition method, attempting to insert in the DB a Task store datum applicable for any struct implementing the CortexORM trait (for example Corpus, Service, Task)

pub fn fetch_tasks(
    &self,
    service: &Service,
    limit: usize
) -> Result<Vec<Task>, Error>
[src]

Fetches no more than limit queued tasks for a given Service

pub fn clear_limbo_tasks(&self) -> Result<usize, Error>[src]

Globally resets any "in progress" tasks back to "queued". Particularly useful for dispatcher restarts, when all "in progress" tasks need to be invalidated

pub fn register_service(
    &self,
    service: &Service,
    corpus_path: &str
) -> Result<(), Error>
[src]

Activates an existing service on a given corpus (via PATH) if the service has previously been registered, this call will RESET the service into a mint state also removing any related log messages.

pub fn extend_service(
    &self,
    service: &Service,
    corpus_path: &str
) -> Result<(), Error>
[src]

Extends an existing service on a given corpus (via PATH) if the service has previously been registered, this call will ignore existing entries and simply add newly encountered ones

pub fn delete_service_by_name(&self, name: &str) -> Result<usize, Error>[src]

Deletes a service by name

pub fn corpora(&self) -> Vec<Corpus>[src]

Returns a vector of currently available corpora in the Task store

pub fn tasks(
    &self,
    corpus: &Corpus,
    service: &Service,
    task_status: &TaskStatus
) -> Vec<Task>
[src]

Returns a vector of tasks for a given Corpus, Service and status

pub fn entries(
    &self,
    corpus: &Corpus,
    service: &Service,
    task_status: &TaskStatus
) -> Vec<String>
[src]

Returns a vector of task entry paths for a given Corpus, Service and status

pub fn task_report(
    &self,
    options: TaskReportOptions
) -> Vec<HashMap<String, String>>
[src]

Given a complex selector, of a Corpus, Service, and the optional severity, category and what, Provide a progress report at the chosen granularity

pub fn progress_report(
    &self,
    corpus: &Corpus,
    service: &Service
) -> HashMap<String, f64>
[src]

Provides a progress report, grouped by severity, for a given Corpus and Service pair

Trait Implementations

impl Default for Backend[src]

Auto Trait Implementations

impl !RefUnwindSafe for Backend

impl Send for Backend

impl !Sync for Backend

impl Unpin for Backend

impl UnwindSafe for Backend

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<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, 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>,