[−][src]Struct cortex::backend::Backend
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]
&self,
corpus: &Corpus,
service: &Service,
owner: String,
description: String
) -> Result<(), Error>
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]
&self,
object: &Model
) -> Result<usize, Error>
Generic delete method, uses primary "id" field
pub fn delete_by<Model: CortexDeletable>(
&self,
object: &Model,
field: &str
) -> Result<usize, Error>
[src]
&self,
object: &Model,
field: &str
) -> Result<usize, Error>
Delete all entries matching the "field" value of a given object
pub fn add<Model: CortexInsertable>(
&self,
object: &Model
) -> Result<usize, Error>
[src]
&self,
object: &Model
) -> Result<usize, Error>
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]
&self,
service: &Service,
limit: usize
) -> Result<Vec<Task>, Error>
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]
&self,
service: &Service,
corpus_path: &str
) -> Result<(), Error>
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]
&self,
service: &Service,
corpus_path: &str
) -> Result<(), Error>
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]
&self,
corpus: &Corpus,
service: &Service,
task_status: &TaskStatus
) -> Vec<Task>
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]
&self,
corpus: &Corpus,
service: &Service,
task_status: &TaskStatus
) -> Vec<String>
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]
&self,
options: TaskReportOptions
) -> Vec<HashMap<String, String>>
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]
&self,
corpus: &Corpus,
service: &Service
) -> HashMap<String, f64>
Provides a progress report, grouped by severity, for a given Corpus
and Service
pair
Trait Implementations
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]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> IntoSql for T
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
&'a Self: AsExpression<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,