Struct autopulse::db::models::ScanEvent

source ·
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

source

pub fn get_targets_hit(&self) -> Vec<String>

source

pub fn add_target_hit(&mut self, target: &str)

Trait Implementations§

source§

impl<'update> AsChangeset for &'update ScanEvent

source§

type Target = table

The table which Self::Changeset will be updating
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

The update statement this type represents
source§

fn as_changeset(self) -> Self::Changeset

Convert self into the actual update statement being executed
source§

impl AsChangeset for ScanEvent

source§

type Target = table

The table which Self::Changeset will be updating
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

The update statement this type represents
source§

fn as_changeset(self) -> Self::Changeset

Convert self into the actual update statement being executed
source§

impl Clone for ScanEvent

source§

fn clone(&self) -> ScanEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ScanEvent

source§

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

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

impl HasTable for ScanEvent

source§

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 ScanEvent

source§

type Id = &'ident String

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<__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 ScanEvent

source§

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§

fn build(row: Self::Row) -> Result<Self>

Construct an instance of this type
source§

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)

The expression you’d like to select. Read more
source§

fn construct_selection() -> Self::SelectExpression

Construct an instance of the expression
source§

impl Serialize for ScanEvent

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

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<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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.

§

impl<T> IntoSql for T

§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>, T: SqlType + TypedExpressionType,

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

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

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

impl<T> Same for T

source§

type Output = T

Should always be Self
§

impl<T, DB> SelectableHelper<DB> for T
where T: Selectable<DB>, DB: Backend,

§

fn as_select() -> SelectBy<T, DB>

Construct a select clause based on a [Selectable] implementation. Read more
§

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 T
where ST: SqlTypeOrSelectable + TupleSize, T: Queryable<ST, DB>, DB: Backend,

§

const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE

The number of fields that this type will consume.
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

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

source§

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
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T