pub trait RootStore: Send + Sync {
// Required methods
fn get_root(&self, name: &str) -> Result<Option<Vec<u8>>, StoreError>;
fn cas_root(
&self,
name: &str,
expected: Option<&[u8]>,
new: &[u8],
) -> Result<(), StoreError>;
fn delete_root(&self, name: &str) -> Result<(), StoreError>;
fn list_roots(&self, prefix: &str) -> Result<Vec<String>, StoreError>;
}Expand description
Named root pointer storage with compare-and-swap fencing.
Required Methods§
Sourcefn cas_root(
&self,
name: &str,
expected: Option<&[u8]>,
new: &[u8],
) -> Result<(), StoreError>
fn cas_root( &self, name: &str, expected: Option<&[u8]>, new: &[u8], ) -> Result<(), StoreError>
Publishes a root only if the stored pointer equals expected.
§Errors
Returns an error if the fence does not match or the backend cannot publish.
Sourcefn delete_root(&self, name: &str) -> Result<(), StoreError>
fn delete_root(&self, name: &str) -> Result<(), StoreError>
Removes a root pointer. Missing roots are ignored.
§Errors
Returns an error if the backend cannot delete the root.
Sourcefn list_roots(&self, prefix: &str) -> Result<Vec<String>, StoreError>
fn list_roots(&self, prefix: &str) -> Result<Vec<String>, StoreError>
Lists root names beginning with prefix, in sorted order.
§Errors
Returns an error if the backend cannot enumerate roots.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".