pub trait StoreFactory: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn create(
&self,
locator: &str,
) -> Result<Arc<dyn PersistenceStore + Sync + Send>, PersistenceError>;
// Provided method
fn matches_content(&self, _header: &[u8]) -> bool { ... }
}Required Methods§
fn name(&self) -> &str
Sourcefn create(
&self,
locator: &str,
) -> Result<Arc<dyn PersistenceStore + Sync + Send>, PersistenceError>
fn create( &self, locator: &str, ) -> Result<Arc<dyn PersistenceStore + Sync + Send>, PersistenceError>
Open or create a store at the given locator path.
Implementations that perform async work (e.g. SQLite) must call this from
a multi-thread tokio runtime — block_in_place will panic on a
current_thread runtime.
Provided Methods§
fn matches_content(&self, _header: &[u8]) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".