pub struct ScanEvent {Show 15 fields
pub id: String,
pub event_source: String,
pub event_timestamp: NaiveDateTime,
pub file_path: String,
pub file_hash: Option<String>,
pub process_status: String,
pub found_status: String,
pub failed_times: i32,
pub next_retry_at: Option<NaiveDateTime>,
pub targets_hit: String,
pub found_at: Option<NaiveDateTime>,
pub processed_at: Option<NaiveDateTime>,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub can_process: NaiveDateTime,
}
Expand description
Represents a scan event.
A scan event is created when a file is added by Triggers.
Fields§
§id: String
The uuid of the scan event.
event_source: String
The name of the Trigger that created the scan event.
event_timestamp: NaiveDateTime
The time the scan event was created.
file_path: String
The rewritten path of the file.
file_hash: Option<String>
Optional hash of the file.
process_status: String
The status of the scan event being processed.
found_status: String
The status of the file being found.
failed_times: i32
The number of times the scan event has failed. Used for retries and is limited to opts.max_retries.
next_retry_at: Option<NaiveDateTime>
The time the scan event will be retried.
targets_hit: String
The targets that have been hit by the scan event delimited by a comma.
found_at: Option<NaiveDateTime>
The time the file was found.
processed_at: Option<NaiveDateTime>
The time the scan event was processed.
created_at: NaiveDateTime
The time the scan event was created.
updated_at: NaiveDateTime
The time the scan event was updated.
can_process: NaiveDateTime
The time the scan event can be processed.
Implementations§
source§impl ScanEvent
impl ScanEvent
pub fn get_targets_hit(&self) -> Vec<String>
pub fn add_target_hit(&mut self, target: &str)
Trait Implementations§
source§impl<'update> AsChangeset for &'update ScanEvent
impl<'update> AsChangeset for &'update ScanEvent
source§type Changeset = <(Grouped<Eq<event_source, <&'update String as AsExpression<<event_source as Expression>::SqlType>>::Expression>>, Grouped<Eq<event_timestamp, <&'update NaiveDateTime as AsExpression<<event_timestamp as Expression>::SqlType>>::Expression>>, Grouped<Eq<file_path, <&'update String as AsExpression<<file_path as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<file_hash, <&'update String as AsExpression<<file_hash as Expression>::SqlType>>::Expression>>>, Grouped<Eq<process_status, <&'update String as AsExpression<<process_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<found_status, <&'update String as AsExpression<<found_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<failed_times, <&'update i32 as AsExpression<<failed_times as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<next_retry_at, <&'update NaiveDateTime as AsExpression<<next_retry_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<targets_hit, <&'update String as AsExpression<<targets_hit as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<found_at, <&'update NaiveDateTime as AsExpression<<found_at as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed_at, <&'update NaiveDateTime as AsExpression<<processed_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<created_at, <&'update NaiveDateTime as AsExpression<<created_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<updated_at, <&'update NaiveDateTime as AsExpression<<updated_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<can_process, <&'update NaiveDateTime as AsExpression<<can_process as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
type Changeset = <(Grouped<Eq<event_source, <&'update String as AsExpression<<event_source as Expression>::SqlType>>::Expression>>, Grouped<Eq<event_timestamp, <&'update NaiveDateTime as AsExpression<<event_timestamp as Expression>::SqlType>>::Expression>>, Grouped<Eq<file_path, <&'update String as AsExpression<<file_path as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<file_hash, <&'update String as AsExpression<<file_hash as Expression>::SqlType>>::Expression>>>, Grouped<Eq<process_status, <&'update String as AsExpression<<process_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<found_status, <&'update String as AsExpression<<found_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<failed_times, <&'update i32 as AsExpression<<failed_times as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<next_retry_at, <&'update NaiveDateTime as AsExpression<<next_retry_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<targets_hit, <&'update String as AsExpression<<targets_hit as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<found_at, <&'update NaiveDateTime as AsExpression<<found_at as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed_at, <&'update NaiveDateTime as AsExpression<<processed_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<created_at, <&'update NaiveDateTime as AsExpression<<created_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<updated_at, <&'update NaiveDateTime as AsExpression<<updated_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<can_process, <&'update NaiveDateTime as AsExpression<<can_process 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 AsChangeset for ScanEvent
impl AsChangeset for ScanEvent
source§type Changeset = <(Grouped<Eq<event_source, <String as AsExpression<<event_source as Expression>::SqlType>>::Expression>>, Grouped<Eq<event_timestamp, <NaiveDateTime as AsExpression<<event_timestamp as Expression>::SqlType>>::Expression>>, Grouped<Eq<file_path, <String as AsExpression<<file_path as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<file_hash, <String as AsExpression<<file_hash as Expression>::SqlType>>::Expression>>>, Grouped<Eq<process_status, <String as AsExpression<<process_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<found_status, <String as AsExpression<<found_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<failed_times, <i32 as AsExpression<<failed_times as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<next_retry_at, <NaiveDateTime as AsExpression<<next_retry_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<targets_hit, <String as AsExpression<<targets_hit as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<found_at, <NaiveDateTime as AsExpression<<found_at as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed_at, <NaiveDateTime as AsExpression<<processed_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<created_at, <NaiveDateTime as AsExpression<<created_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<updated_at, <NaiveDateTime as AsExpression<<updated_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<can_process, <NaiveDateTime as AsExpression<<can_process as Expression>::SqlType>>::Expression>>) as AsChangeset>::Changeset
type Changeset = <(Grouped<Eq<event_source, <String as AsExpression<<event_source as Expression>::SqlType>>::Expression>>, Grouped<Eq<event_timestamp, <NaiveDateTime as AsExpression<<event_timestamp as Expression>::SqlType>>::Expression>>, Grouped<Eq<file_path, <String as AsExpression<<file_path as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<file_hash, <String as AsExpression<<file_hash as Expression>::SqlType>>::Expression>>>, Grouped<Eq<process_status, <String as AsExpression<<process_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<found_status, <String as AsExpression<<found_status as Expression>::SqlType>>::Expression>>, Grouped<Eq<failed_times, <i32 as AsExpression<<failed_times as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<next_retry_at, <NaiveDateTime as AsExpression<<next_retry_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<targets_hit, <String as AsExpression<<targets_hit as Expression>::SqlType>>::Expression>>, Option<Grouped<Eq<found_at, <NaiveDateTime as AsExpression<<found_at as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed_at, <NaiveDateTime as AsExpression<<processed_at as Expression>::SqlType>>::Expression>>>, Grouped<Eq<created_at, <NaiveDateTime as AsExpression<<created_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<updated_at, <NaiveDateTime as AsExpression<<updated_at as Expression>::SqlType>>::Expression>>, Grouped<Eq<can_process, <NaiveDateTime as AsExpression<<can_process 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<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14), __DB> for ScanEventwhere
(String, String, NaiveDateTime, String, Option<String>, String, String, i32, Option<NaiveDateTime>, String, Option<NaiveDateTime>, Option<NaiveDateTime>, NaiveDateTime, NaiveDateTime, NaiveDateTime): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14), __DB>,
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14), __DB> for ScanEventwhere
(String, String, NaiveDateTime, String, Option<String>, String, String, i32, Option<NaiveDateTime>, String, Option<NaiveDateTime>, Option<NaiveDateTime>, NaiveDateTime, NaiveDateTime, NaiveDateTime): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14), __DB>,
source§type Row = (String, String, NaiveDateTime, String, Option<String>, String, String, i32, Option<NaiveDateTime>, String, Option<NaiveDateTime>, Option<NaiveDateTime>, NaiveDateTime, NaiveDateTime, NaiveDateTime)
type Row = (String, String, NaiveDateTime, String, Option<String>, String, String, i32, Option<NaiveDateTime>, String, Option<NaiveDateTime>, Option<NaiveDateTime>, NaiveDateTime, NaiveDateTime, NaiveDateTime)
The Rust type you’d like to map from. Read more
source§impl<__DB: Backend> Selectable<__DB> for ScanEvent
impl<__DB: Backend> Selectable<__DB> for ScanEvent
source§type SelectExpression = (id, event_source, event_timestamp, file_path, file_hash, process_status, found_status, failed_times, next_retry_at, targets_hit, found_at, processed_at, created_at, updated_at, can_process)
type SelectExpression = (id, event_source, event_timestamp, file_path, file_hash, process_status, found_status, failed_times, next_retry_at, targets_hit, found_at, processed_at, created_at, updated_at, can_process)
The expression you’d like to select. Read more
source§fn construct_selection() -> Self::SelectExpression
fn construct_selection() -> Self::SelectExpression
Construct an instance of the expression
Auto Trait Implementations§
impl Freeze for ScanEvent
impl RefUnwindSafe for ScanEvent
impl Send for ScanEvent
impl Sync for ScanEvent
impl Unpin for ScanEvent
impl UnwindSafe for ScanEvent
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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>
§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
§fn as_select() -> SelectBy<T, DB>
fn as_select() -> SelectBy<T, DB>
Construct a select clause based on a [
Selectable
] implementation. Read more§fn as_returning() -> SelectBy<Self, DB>
fn as_returning() -> SelectBy<Self, DB>
An alias for
as_select
that can be used with returning clauses§impl<T, ST, DB> StaticallySizedRow<ST, DB> for Twhere
ST: SqlTypeOrSelectable + TupleSize,
T: Queryable<ST, DB>,
DB: Backend,
impl<T, ST, DB> StaticallySizedRow<ST, DB> for Twhere
ST: SqlTypeOrSelectable + TupleSize,
T: Queryable<ST, DB>,
DB: Backend,
§const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
The number of fields that this type will consume.