pub struct SqliteStorage { /* private fields */ }Expand description
SQLite storage backend. Each collection maps to a table; JSON fields are stored as TEXT columns and (de)serialized on write/read.
Implementations§
Trait Implementations§
Source§impl Storage for SqliteStorage
impl Storage for SqliteStorage
fn kind(&self) -> &str
Source§fn ping(&mut self) -> Result<bool>
fn ping(&mut self) -> Result<bool>
Verify connectivity (PocketBase health / SQLite open + query).
Source§fn ensure_schema(&mut self) -> Result<()>
fn ensure_schema(&mut self) -> Result<()>
Create all required collections/tables if they do not exist.
fn upsert_scan_run(&mut self, run: &ScanRun) -> Result<()>
fn get_scan_run(&mut self, run_id: &str) -> Result<Option<ScanRun>>
fn list_scan_runs(&mut self) -> Result<Vec<ScanRun>>
Source§fn delete_scan_run(&mut self, run_id: &str) -> Result<()>
fn delete_scan_run(&mut self, run_id: &str) -> Result<()>
Delete a scan run and the records owned by it (observations and
exploit executions). Assets, services and findings are shared across
runs and are left untouched.
fn upsert_asset(&mut self, asset: &Asset) -> Result<()>
fn get_asset(&mut self, asset_id: &str) -> Result<Option<Asset>>
fn list_assets(&mut self) -> Result<Vec<Asset>>
fn upsert_service(&mut self, service: &Service) -> Result<()>
fn get_service(&mut self, service_id: &str) -> Result<Option<Service>>
fn list_services_for_asset(&mut self, asset_id: &str) -> Result<Vec<Service>>
fn list_all_services(&mut self) -> Result<Vec<Service>>
fn upsert_finding(&mut self, finding: &Finding) -> Result<()>
fn get_finding(&mut self, finding_id: &str) -> Result<Option<Finding>>
fn list_findings_for_asset(&mut self, asset_id: &str) -> Result<Vec<Finding>>
fn list_all_findings(&mut self) -> Result<Vec<Finding>>
fn add_observation(&mut self, observation: &Observation) -> Result<()>
fn get_observation(&mut self, obs_id: &str) -> Result<Option<Observation>>
fn list_observations_for( &mut self, subject_type: &str, subject_id: &str, ) -> Result<Vec<Observation>>
fn list_all_observations(&mut self) -> Result<Vec<Observation>>
fn upsert_exploit_execution( &mut self, execution: &ExploitExecution, ) -> Result<()>
fn get_exploit_execution( &mut self, execution_id: &str, ) -> Result<Option<ExploitExecution>>
fn list_exploit_executions(&mut self) -> Result<Vec<ExploitExecution>>
fn list_exploit_executions_for_run( &mut self, run_id: &str, ) -> Result<Vec<ExploitExecution>>
Auto Trait Implementations§
impl !Freeze for SqliteStorage
impl !RefUnwindSafe for SqliteStorage
impl !Sync for SqliteStorage
impl !UnwindSafe for SqliteStorage
impl Send for SqliteStorage
impl Unpin for SqliteStorage
impl UnsafeUnpin for SqliteStorage
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more