pub trait GenomeStorage: Send + Sync {
// Required methods
fn load_genome(
&self,
genome_id: &str,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + '_>>;
fn save_genome(
&self,
genome_id: &str,
genome_json: &str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + '_>>;
fn list_genomes(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + '_>>;
fn delete_genome(
&self,
genome_id: &str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + '_>>;
}Expand description
Platform-agnostic genome storage trait
This trait abstracts genome persistence across platforms:
- Desktop: File system storage
- WASM: IndexedDB storage
All operations are async to support both blocking (file I/O) and non-blocking (IndexedDB) storage backends.
Required Methods§
Sourcefn load_genome(
&self,
genome_id: &str,
) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + '_>>
fn load_genome( &self, genome_id: &str, ) -> Pin<Box<dyn Future<Output = Result<String, StorageError>> + Send + '_>>
Sourcefn save_genome(
&self,
genome_id: &str,
genome_json: &str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + '_>>
fn save_genome( &self, genome_id: &str, genome_json: &str, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + '_>>
Sourcefn list_genomes(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + '_>>
fn list_genomes( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + '_>>
List all available genome IDs
§Returns
Ok(Vec<String>) with all genome IDs,
Err(StorageError::IOError) for I/O failures