pub trait SchemaStore:
Send
+ Sync
+ 'static {
// Required methods
fn put_version(
&self,
version: SchemaVersion,
) -> impl Future<Output = SchemaVersion> + Send;
fn get_version(
&self,
id: &SchemaVersionId,
) -> impl Future<Output = Option<SchemaVersion>> + Send;
fn latest_version_for_method(
&self,
upstream_id: &str,
method: &str,
) -> impl Future<Output = Option<SchemaVersion>> + Send;
fn list_versions(
&self,
upstream_id: &str,
method: &str,
) -> impl Future<Output = Vec<SchemaVersion>> + Send;
// Provided method
fn prune(
&self,
_upstream_id: &str,
_method: &str,
_keep: usize,
) -> impl Future<Output = ()> + Send { ... }
}Expand description
Trait for schema version storage backends.
Implementations must be Send + Sync + 'static so a single store
can back many concurrent SchemaManager readers.
Required Methods§
Sourcefn put_version(
&self,
version: SchemaVersion,
) -> impl Future<Output = SchemaVersion> + Send
fn put_version( &self, version: SchemaVersion, ) -> impl Future<Output = SchemaVersion> + Send
Insert a new version. Implementations handle retention / eviction.
Returns the stored version (the caller may not have populated
version correctly — implementations may assign it).
Sourcefn get_version(
&self,
id: &SchemaVersionId,
) -> impl Future<Output = Option<SchemaVersion>> + Send
fn get_version( &self, id: &SchemaVersionId, ) -> impl Future<Output = Option<SchemaVersion>> + Send
Fetch a specific version by id. None if never stored or evicted.
Sourcefn latest_version_for_method(
&self,
upstream_id: &str,
method: &str,
) -> impl Future<Output = Option<SchemaVersion>> + Send
fn latest_version_for_method( &self, upstream_id: &str, method: &str, ) -> impl Future<Output = Option<SchemaVersion>> + Send
Latest version for a given (upstream_id, method).
Sourcefn list_versions(
&self,
upstream_id: &str,
method: &str,
) -> impl Future<Output = Vec<SchemaVersion>> + Send
fn list_versions( &self, upstream_id: &str, method: &str, ) -> impl Future<Output = Vec<SchemaVersion>> + Send
All versions for a given (upstream_id, method), newest first.
Bounded by the store’s retention policy.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.