pub struct RedbStorage { /* private fields */ }Expand description
redb storage backend for fast caching
Implementations§
Source§impl RedbStorage
impl RedbStorage
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn store_embedding_impl(
&self,
id: &str,
embedding: Vec<f32>,
) -> Result<()>
pub async fn store_embedding_impl( &self, id: &str, embedding: Vec<f32>, ) -> Result<()>
Store embedding implementation
Sourcepub async fn get_embedding_impl(&self, id: &str) -> Result<Option<Vec<f32>>>
pub async fn get_embedding_impl(&self, id: &str) -> Result<Option<Vec<f32>>>
Retrieve embedding implementation
Sourcepub async fn delete_embedding_impl(&self, id: &str) -> Result<bool>
pub async fn delete_embedding_impl(&self, id: &str) -> Result<bool>
Delete embedding implementation
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn store_episode(&self, episode: &Episode) -> Result<()>
pub async fn store_episode(&self, episode: &Episode) -> Result<()>
Store an episode in cache
Sourcepub async fn get_episode(&self, episode_id: Uuid) -> Result<Option<Episode>>
pub async fn get_episode(&self, episode_id: Uuid) -> Result<Option<Episode>>
Retrieve an episode from cache
Sourcepub async fn get_all_episodes(&self, query: &RedbQuery) -> Result<Vec<Episode>>
pub async fn get_all_episodes(&self, query: &RedbQuery) -> Result<Vec<Episode>>
Get all episodes from cache (with optional limit)
Sourcepub async fn delete_episode(&self, episode_id: Uuid) -> Result<()>
pub async fn delete_episode(&self, episode_id: Uuid) -> Result<()>
Delete an episode from cache
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn query_episodes_since(
&self,
since: DateTime<Utc>,
limit: Option<usize>,
) -> Result<Vec<Episode>>
pub async fn query_episodes_since( &self, since: DateTime<Utc>, limit: Option<usize>, ) -> Result<Vec<Episode>>
Query episodes modified since a given timestamp
Returns all episodes where start_time >= the given timestamp. This is used for incremental synchronization.
Note: This scans all episodes in the cache and filters by timestamp, which may be slow for large datasets. Consider using Turso for efficient timestamp-based queries.
§Arguments
since- Timestamp to query fromlimit- Maximum number of episodes to return (default: 100, max: 1000)
Sourcepub async fn query_episodes_by_metadata(
&self,
key: &str,
value: &str,
limit: Option<usize>,
) -> Result<Vec<Episode>>
pub async fn query_episodes_by_metadata( &self, key: &str, value: &str, limit: Option<usize>, ) -> Result<Vec<Episode>>
Query episodes by metadata key-value pair
This method searches through all episodes and returns those whose metadata contains the specified key-value pair. This is less efficient than timestamp-based queries but necessary for metadata-based searches.
§Arguments
key- Metadata key to search forvalue- Metadata value to matchlimit- Maximum number of episodes to return (default: 100, max: 1000)
§Returns
Vector of episodes matching the metadata criteria
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn store_episode_summary(
&self,
summary: &EpisodeSummary,
) -> Result<()>
pub async fn store_episode_summary( &self, summary: &EpisodeSummary, ) -> Result<()>
Store an episode summary.
Stores a semantic summary of an episode for efficient retrieval. Uses postcard serialization for compact storage.
§Arguments
summary- The episode summary to store
§Returns
Ok(()) on success, error otherwise.
§Examples
let summary = EpisodeSummary {
episode_id: Uuid::new_v4(),
summary_text: "Task completed successfully".to_string(),
key_concepts: vec!["rust".to_string(), "testing".to_string()],
key_steps: vec!["Step 1: Initialize".to_string()],
summary_embedding: None,
created_at: Utc::now(),
};
storage.store_episode_summary(&summary).await?;Sourcepub async fn get_episode_summary(
&self,
episode_id: Uuid,
) -> Result<Option<EpisodeSummary>>
pub async fn get_episode_summary( &self, episode_id: Uuid, ) -> Result<Option<EpisodeSummary>>
Retrieve an episode summary.
§Arguments
episode_id- ID of the episode whose summary to retrieve
§Returns
The episode summary if found, None otherwise.
§Examples
let episode_id = Uuid::new_v4();
if let Some(summary) = storage.get_episode_summary(episode_id).await? {
println!("Summary: {}", summary.summary_text);
}Sourcepub async fn store_episode_with_capacity(
&self,
episode: &Episode,
summary: Option<&EpisodeSummary>,
capacity_manager: &CapacityManager,
) -> Result<Option<Vec<Uuid>>>
pub async fn store_episode_with_capacity( &self, episode: &Episode, summary: Option<&EpisodeSummary>, capacity_manager: &CapacityManager, ) -> Result<Option<Vec<Uuid>>>
Store an episode with capacity enforcement.
This method enforces capacity limits by evicting low-relevance episodes when storage is full. The eviction and insertion happen atomically in a single write transaction to ensure consistency.
§Arguments
episode- The episode to storesummary- Optional episode summary to store alongsidecapacity_manager- Manager that determines eviction policy
§Returns
Ok(Some(evicted_ids)) if episodes were evicted, Ok(None) if no eviction needed.
§Examples
let capacity_mgr = CapacityManager::new(100, EvictionPolicy::RelevanceWeighted);
let episode = Episode::new(
"Test task".to_string(),
TaskContext::default(),
TaskType::Testing,
);
let evicted = storage.store_episode_with_capacity(&episode, None, &capacity_mgr).await?;
if let Some(evicted_ids) = evicted {
println!("Evicted {} episodes", evicted_ids.len());
}Source§impl RedbStorage
impl RedbStorage
Source§impl RedbStorage
impl RedbStorage
Source§impl RedbStorage
impl RedbStorage
pub async fn store_recommendation_session( &self, session: &RecommendationSession, ) -> Result<()>
pub async fn get_recommendation_session( &self, session_id: Uuid, ) -> Result<Option<RecommendationSession>>
pub async fn get_recommendation_session_for_episode( &self, episode_id: Uuid, ) -> Result<Option<RecommendationSession>>
pub async fn store_recommendation_feedback( &self, feedback: &RecommendationFeedback, ) -> Result<()>
pub async fn get_recommendation_feedback( &self, session_id: Uuid, ) -> Result<Option<RecommendationFeedback>>
pub async fn get_recommendation_stats(&self) -> Result<RecommendationStats>
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn store_relationship(
&self,
relationship: &EpisodeRelationship,
) -> Result<()>
pub async fn store_relationship( &self, relationship: &EpisodeRelationship, ) -> Result<()>
Store a relationship (StorageBackend trait)
Sourcepub async fn remove_relationship(&self, relationship_id: Uuid) -> Result<()>
pub async fn remove_relationship(&self, relationship_id: Uuid) -> Result<()>
Remove a relationship (StorageBackend trait)
Sourcepub async fn get_relationships(
&self,
episode_id: Uuid,
direction: Direction,
) -> Result<Vec<EpisodeRelationship>>
pub async fn get_relationships( &self, episode_id: Uuid, direction: Direction, ) -> Result<Vec<EpisodeRelationship>>
Get relationships (StorageBackend trait)
Sourcepub async fn relationship_exists(
&self,
from_episode_id: Uuid,
to_episode_id: Uuid,
relationship_type: RelationshipType,
) -> Result<bool>
pub async fn relationship_exists( &self, from_episode_id: Uuid, to_episode_id: Uuid, relationship_type: RelationshipType, ) -> Result<bool>
Check if relationship exists (StorageBackend trait)
Sourcepub fn cache_relationship(
&self,
relationship: &EpisodeRelationship,
) -> Result<()>
pub fn cache_relationship( &self, relationship: &EpisodeRelationship, ) -> Result<()>
Cache a relationship
Sourcepub fn get_cached_relationship(
&self,
relationship_id: Uuid,
) -> Result<Option<EpisodeRelationship>>
pub fn get_cached_relationship( &self, relationship_id: Uuid, ) -> Result<Option<EpisodeRelationship>>
Get a cached relationship by ID
Sourcepub fn remove_cached_relationship(&self, relationship_id: Uuid) -> Result<()>
pub fn remove_cached_relationship(&self, relationship_id: Uuid) -> Result<()>
Remove a relationship from cache
Sourcepub fn get_cached_relationships(
&self,
episode_id: Uuid,
direction: Direction,
) -> Result<Vec<EpisodeRelationship>>
pub fn get_cached_relationships( &self, episode_id: Uuid, direction: Direction, ) -> Result<Vec<EpisodeRelationship>>
Get all cached relationships for an episode
Sourcepub fn clear_relationships_cache(&self) -> Result<()>
pub fn clear_relationships_cache(&self) -> Result<()>
Clear all cached relationships
Sourcepub fn count_cached_relationships(&self) -> Result<usize>
pub fn count_cached_relationships(&self) -> Result<usize>
Get count of cached relationships
Source§impl RedbStorage
impl RedbStorage
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn get_statistics(&self) -> Result<StorageStatistics>
pub async fn get_statistics(&self) -> Result<StorageStatistics>
Get database statistics
Sourcepub async fn health_check(&self) -> Result<bool>
pub async fn health_check(&self) -> Result<bool>
Health check - verify database accessibility
Sourcepub async fn get_cache_metrics(&self) -> CacheMetrics
pub async fn get_cache_metrics(&self) -> CacheMetrics
Get cache metrics
Returns current cache performance metrics including hit rate, miss rate, eviction count, and size statistics.
§Example
let metrics = storage.get_cache_metrics().await;
println!("Cache hit rate: {:.2}%", metrics.hit_rate * 100.0);
println!("Cache size: {} items, {} bytes", metrics.item_count, metrics.total_size_bytes);Sourcepub async fn cleanup_cache(&self) -> usize
pub async fn cleanup_cache(&self) -> usize
Manually trigger cache cleanup to remove expired entries
Returns the number of expired entries removed.
This is useful for testing or when you want to force cleanup without waiting for the background task.
Source§impl RedbStorage
impl RedbStorage
Sourcepub async fn new_with_cache_config(
path: &Path,
cache_config: CacheConfig,
) -> Result<Self>
pub async fn new_with_cache_config( path: &Path, cache_config: CacheConfig, ) -> Result<Self>
Create a new redb storage instance with custom cache configuration
Uses the legacy LRUCache implementation. For adaptive TTL features,
use new_with_adaptive_config instead.
§Arguments
path- Path to the redb database filecache_config- Cache configuration settings
§Example
let config = CacheConfig {
max_size: 500,
default_ttl_secs: 1800,
cleanup_interval_secs: 600,
enable_background_cleanup: true,
};
let storage = RedbStorage::new_with_cache_config(Path::new("./memory.redb"), config).await?;Sourcepub async fn new_with_adaptive_config(
path: &Path,
config: AdaptiveCacheConfig,
) -> Result<Self>
pub async fn new_with_adaptive_config( path: &Path, config: AdaptiveCacheConfig, ) -> Result<Self>
Create a new redb storage instance with adaptive cache configuration
Uses AdaptiveCacheAdapter for intelligent TTL adjustment based on
access patterns. Frequently accessed items get longer TTL, rarely
accessed items get shorter TTL.
§Arguments
path- Path to the redb database fileconfig- Adaptive cache configuration settings
§Example
let config = AdaptiveCacheConfig {
max_size: 1000,
default_ttl: Duration::from_secs(1800),
min_ttl: Duration::from_secs(300),
max_ttl: Duration::from_secs(7200),
..Default::default()
};
let storage = RedbStorage::new_with_adaptive_config(Path::new("./memory.redb"), config).await?;Trait Implementations§
Source§impl EmbeddingStorageBackend for RedbStorage
impl EmbeddingStorageBackend for RedbStorage
Source§fn store_episode_embedding<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
embedding: Vec<f32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_episode_embedding<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
embedding: Vec<f32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn store_pattern_embedding<'life0, 'async_trait>(
&'life0 self,
pattern_id: PatternId,
embedding: Vec<f32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_pattern_embedding<'life0, 'async_trait>(
&'life0 self,
pattern_id: PatternId,
embedding: Vec<f32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_episode_embedding<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_episode_embedding<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_pattern_embedding<'life0, 'async_trait>(
&'life0 self,
pattern_id: PatternId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pattern_embedding<'life0, 'async_trait>(
&'life0 self,
pattern_id: PatternId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn find_similar_episodes<'life0, 'async_trait>(
&'life0 self,
query_embedding: Vec<f32>,
limit: usize,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimilaritySearchResult<Episode>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_similar_episodes<'life0, 'async_trait>(
&'life0 self,
query_embedding: Vec<f32>,
limit: usize,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimilaritySearchResult<Episode>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn find_similar_patterns<'life0, 'async_trait>(
&'life0 self,
query_embedding: Vec<f32>,
limit: usize,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimilaritySearchResult<Pattern>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_similar_patterns<'life0, 'async_trait>(
&'life0 self,
query_embedding: Vec<f32>,
limit: usize,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimilaritySearchResult<Pattern>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl StorageBackend for RedbStorage
impl StorageBackend for RedbStorage
Source§fn store_episode<'life0, 'life1, 'async_trait>(
&'life0 self,
episode: &'life1 Episode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_episode<'life0, 'life1, 'async_trait>(
&'life0 self,
episode: &'life1 Episode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_episode<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Episode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_episode<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Episode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn delete_episode<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_episode<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn store_pattern<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: &'life1 Pattern,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_pattern<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: &'life1 Pattern,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_pattern<'life0, 'async_trait>(
&'life0 self,
id: PatternId,
) -> Pin<Box<dyn Future<Output = Result<Option<Pattern>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pattern<'life0, 'async_trait>(
&'life0 self,
id: PatternId,
) -> Pin<Box<dyn Future<Output = Result<Option<Pattern>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn store_heuristic<'life0, 'life1, 'async_trait>(
&'life0 self,
heuristic: &'life1 Heuristic,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_heuristic<'life0, 'life1, 'async_trait>(
&'life0 self,
heuristic: &'life1 Heuristic,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_heuristic<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Heuristic>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_heuristic<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Heuristic>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn query_episodes_since<'life0, 'async_trait>(
&'life0 self,
since: DateTime<Utc>,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_episodes_since<'life0, 'async_trait>(
&'life0 self,
since: DateTime<Utc>,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn query_episodes_by_metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_episodes_by_metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn store_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn delete_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn store_embeddings_batch<'life0, 'async_trait>(
&'life0 self,
embeddings: Vec<(String, Vec<f32>)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_embeddings_batch<'life0, 'async_trait>(
&'life0 self,
embeddings: Vec<(String, Vec<f32>)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_embeddings_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Vec<f32>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_embeddings_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Vec<f32>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn store_relationship<'life0, 'life1, 'async_trait>(
&'life0 self,
relationship: &'life1 EpisodeRelationship,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_relationship<'life0, 'life1, 'async_trait>(
&'life0 self,
relationship: &'life1 EpisodeRelationship,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn remove_relationship<'life0, 'async_trait>(
&'life0 self,
relationship_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_relationship<'life0, 'async_trait>(
&'life0 self,
relationship_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_relationships<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
direction: Direction,
) -> Pin<Box<dyn Future<Output = Result<Vec<EpisodeRelationship>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_relationships<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
direction: Direction,
) -> Pin<Box<dyn Future<Output = Result<Vec<EpisodeRelationship>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn relationship_exists<'life0, 'async_trait>(
&'life0 self,
from_episode_id: Uuid,
to_episode_id: Uuid,
relationship_type: RelationshipType,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn relationship_exists<'life0, 'async_trait>(
&'life0 self,
from_episode_id: Uuid,
to_episode_id: Uuid,
relationship_type: RelationshipType,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn store_recommendation_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 RecommendationSession,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_recommendation_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 RecommendationSession,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_recommendation_session<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<RecommendationSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_recommendation_session<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<RecommendationSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_recommendation_session_for_episode<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<RecommendationSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_recommendation_session_for_episode<'life0, 'async_trait>(
&'life0 self,
episode_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<RecommendationSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn store_recommendation_feedback<'life0, 'life1, 'async_trait>(
&'life0 self,
feedback: &'life1 RecommendationFeedback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_recommendation_feedback<'life0, 'life1, 'async_trait>(
&'life0 self,
feedback: &'life1 RecommendationFeedback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_recommendation_feedback<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<RecommendationFeedback>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_recommendation_feedback<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<RecommendationFeedback>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_recommendation_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecommendationStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_recommendation_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecommendationStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn cleanup_episodes<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 EpisodeRetentionPolicy,
) -> Pin<Box<dyn Future<Output = Result<CleanupResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn cleanup_episodes<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 EpisodeRetentionPolicy,
) -> Pin<Box<dyn Future<Output = Result<CleanupResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn count_cleanup_candidates<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 EpisodeRetentionPolicy,
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn count_cleanup_candidates<'life0, 'life1, 'async_trait>(
&'life0 self,
policy: &'life1 EpisodeRetentionPolicy,
) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for RedbStorage
impl !RefUnwindSafe for RedbStorage
impl Send for RedbStorage
impl Sync for RedbStorage
impl Unpin for RedbStorage
impl UnsafeUnpin for RedbStorage
impl !UnwindSafe for RedbStorage
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> 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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.