pub struct DaemonStorage { /* private fields */ }Expand description
Main storage wrapper for the daemon.
Implementations§
Source§impl DaemonStorage
impl DaemonStorage
Sourcepub fn save_test_node(&self, node: &TestNode) -> Result<()>
pub fn save_test_node(&self, node: &TestNode) -> Result<()>
Save a test node to inventory.
Sourcepub fn save_test_nodes_batch(&self, nodes: &[TestNode]) -> Result<()>
pub fn save_test_nodes_batch(&self, nodes: &[TestNode]) -> Result<()>
Save multiple test nodes to inventory in a batch (much faster than individual saves).
Sourcepub fn load_test_node(&self, node_id: &str) -> Result<Option<TestNode>>
pub fn load_test_node(&self, node_id: &str) -> Result<Option<TestNode>>
Load a test node from inventory.
Sourcepub fn get_all_inventory(&self) -> Result<Vec<TestNode>>
pub fn get_all_inventory(&self) -> Result<Vec<TestNode>>
Get all test nodes in inventory.
Sourcepub fn inventory_count(&self) -> usize
pub fn inventory_count(&self) -> usize
Get inventory count.
Sourcepub fn clear_inventory(&self) -> Result<()>
pub fn clear_inventory(&self) -> Result<()>
Clear inventory.
Sourcepub fn save_native_test(&self, node: &NativeTestNode) -> Result<()>
pub fn save_native_test(&self, node: &NativeTestNode) -> Result<()>
Save a native test node.
Sourcepub fn save_native_tests_batch(&self, nodes: &[NativeTestNode]) -> Result<()>
pub fn save_native_tests_batch(&self, nodes: &[NativeTestNode]) -> Result<()>
Save multiple native test nodes in a batch (much faster than individual saves).
Sourcepub fn load_native_test(&self, node_id: &str) -> Result<Option<NativeTestNode>>
pub fn load_native_test(&self, node_id: &str) -> Result<Option<NativeTestNode>>
Load a native test node.
Sourcepub fn get_all_native_tests(&self) -> Result<Vec<NativeTestNode>>
pub fn get_all_native_tests(&self) -> Result<Vec<NativeTestNode>>
Get all native tests.
Sourcepub fn clear_native_tests(&self) -> Result<()>
pub fn clear_native_tests(&self) -> Result<()>
Clear native tests.
Sourcepub fn save_flakiness_record(&self, record: &FlakinessRecord) -> Result<()>
pub fn save_flakiness_record(&self, record: &FlakinessRecord) -> Result<()>
Save flakiness record.
Sourcepub fn load_flakiness_record(
&self,
node_id: &str,
) -> Result<Option<FlakinessRecord>>
pub fn load_flakiness_record( &self, node_id: &str, ) -> Result<Option<FlakinessRecord>>
Load flakiness record.
Sourcepub fn get_all_flakiness(&self) -> Result<Vec<FlakinessRecord>>
pub fn get_all_flakiness(&self) -> Result<Vec<FlakinessRecord>>
Get all flakiness records.
Sourcepub fn delete_flakiness_record(&self, node_id: &str) -> Result<()>
pub fn delete_flakiness_record(&self, node_id: &str) -> Result<()>
Delete flakiness record.
Sourcepub fn save_fixture(
&self,
context_id: &str,
fixture: &FixtureState,
) -> Result<()>
pub fn save_fixture( &self, context_id: &str, fixture: &FixtureState, ) -> Result<()>
Save fixture state.
Sourcepub fn load_fixture(
&self,
context_id: &str,
name: &str,
) -> Result<Option<FixtureState>>
pub fn load_fixture( &self, context_id: &str, name: &str, ) -> Result<Option<FixtureState>>
Load fixture state.
Sourcepub fn get_context_fixtures(
&self,
context_id: &str,
) -> Result<Vec<FixtureState>>
pub fn get_context_fixtures( &self, context_id: &str, ) -> Result<Vec<FixtureState>>
Get all fixtures for a context.
Sourcepub fn clear_context_fixtures(&self, context_id: &str) -> Result<()>
pub fn clear_context_fixtures(&self, context_id: &str) -> Result<()>
Clear all fixtures for a context.
Sourcepub fn save_duration_history(
&self,
node_id: &str,
durations: &[u64],
) -> Result<()>
pub fn save_duration_history( &self, node_id: &str, durations: &[u64], ) -> Result<()>
Save duration history for a test.
Sourcepub fn load_duration_history(&self, node_id: &str) -> Result<Option<Vec<u64>>>
pub fn load_duration_history(&self, node_id: &str) -> Result<Option<Vec<u64>>>
Load duration history for a test.
Sourcepub fn get_average_duration(&self, node_id: &str) -> Result<Option<u64>>
pub fn get_average_duration(&self, node_id: &str) -> Result<Option<u64>>
Get average duration for a test.
Sourcepub fn save_duration_history_batch(
&self,
histories: &[(&str, &[u64])],
) -> Result<()>
pub fn save_duration_history_batch( &self, histories: &[(&str, &[u64])], ) -> Result<()>
Save duration history for multiple tests in a batch (much faster than individual saves).
Sourcepub fn save_scheduled_test(&self, test: &ScheduledTest) -> Result<()>
pub fn save_scheduled_test(&self, test: &ScheduledTest) -> Result<()>
Save scheduled test.
Sourcepub fn get_all_scheduled_tests(&self) -> Result<Vec<ScheduledTest>>
pub fn get_all_scheduled_tests(&self) -> Result<Vec<ScheduledTest>>
Load all scheduled tests.
Sourcepub fn clear_scheduler(&self) -> Result<()>
pub fn clear_scheduler(&self) -> Result<()>
Clear scheduler.
Sourcepub fn save_context(&self, context_id: &str, data: &Value) -> Result<()>
pub fn save_context(&self, context_id: &str, data: &Value) -> Result<()>
Save context metadata (simple string map).
Sourcepub fn get_all_context_ids(&self) -> Vec<String>
pub fn get_all_context_ids(&self) -> Vec<String>
Get all context IDs.
Sourcepub fn delete_context(&self, context_id: &str) -> Result<()>
pub fn delete_context(&self, context_id: &str) -> Result<()>
Delete context.
Sourcepub fn evict_old_data(&self, _max_age_days: u32) -> Result<usize>
pub fn evict_old_data(&self, _max_age_days: u32) -> Result<usize>
Evict old data that hasn’t been accessed in max_age_days.
Returns the number of records removed.
Sourcepub fn compact_async(&self)
pub fn compact_async(&self)
Trigger background compaction to reclaim disk space.
Trait Implementations§
Source§impl Clone for DaemonStorage
impl Clone for DaemonStorage
Source§fn clone(&self) -> DaemonStorage
fn clone(&self) -> DaemonStorage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DaemonStorage
impl !UnwindSafe for DaemonStorage
impl Freeze for DaemonStorage
impl Send for DaemonStorage
impl Sync for DaemonStorage
impl Unpin for DaemonStorage
impl UnsafeUnpin for DaemonStorage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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