pub struct MemorySchemaStore { /* private fields */ }Expand description
In-memory SchemaStore backed by DashMap.
Each (upstream_id, method) key owns a FIFO ring buffer of at most
capacity versions. On insert overflow, the oldest version is
dropped and its id removed from the lookup index.
Implementations§
Source§impl MemorySchemaStore
impl MemorySchemaStore
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Trait Implementations§
Source§impl Clone for MemorySchemaStore
impl Clone for MemorySchemaStore
Source§fn clone(&self) -> MemorySchemaStore
fn clone(&self) -> MemorySchemaStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemorySchemaStore
impl Default for MemorySchemaStore
Source§impl SchemaStore for MemorySchemaStore
impl SchemaStore for MemorySchemaStore
Source§async fn put_version(&self, version: SchemaVersion) -> SchemaVersion
async fn put_version(&self, version: SchemaVersion) -> SchemaVersion
Insert a new version. Implementations handle retention / eviction.
Returns the stored version (the caller may not have populated
version correctly — implementations may assign it).Source§async fn get_version(&self, id: &SchemaVersionId) -> Option<SchemaVersion>
async fn get_version(&self, id: &SchemaVersionId) -> Option<SchemaVersion>
Fetch a specific version by id.
None if never stored or evicted.Source§async fn latest_version_for_method(
&self,
upstream_id: &str,
method: &str,
) -> Option<SchemaVersion>
async fn latest_version_for_method( &self, upstream_id: &str, method: &str, ) -> Option<SchemaVersion>
Latest version for a given
(upstream_id, method).Source§async fn list_versions(
&self,
upstream_id: &str,
method: &str,
) -> Vec<SchemaVersion>
async fn list_versions( &self, upstream_id: &str, method: &str, ) -> Vec<SchemaVersion>
All versions for a given
(upstream_id, method), newest first.
Bounded by the store’s retention policy.Auto Trait Implementations§
impl Freeze for MemorySchemaStore
impl !RefUnwindSafe for MemorySchemaStore
impl Send for MemorySchemaStore
impl Sync for MemorySchemaStore
impl Unpin for MemorySchemaStore
impl UnsafeUnpin for MemorySchemaStore
impl !UnwindSafe for MemorySchemaStore
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
Mutably borrows from an owned value. Read more