pub trait LeafStore: Debug {
Show 17 methods
// Required methods
fn key_resolvers(
&self,
) -> Box<dyn Iterator<Item = &dyn KeyResolverImpl<Digest>> + '_>;
fn encryption_algorithms(
&self,
) -> Box<dyn Iterator<Item = &dyn EncryptionAlgorithmImpl<Digest>> + '_>;
fn create_subspace(&self) -> impl Future<Output = Result<SubspaceId>>;
fn get_subspace_secret(
&self,
subspace: SubspaceId,
) -> impl Future<Output = Result<Option<SubspaceSecretKey>>>;
fn list_subspaces(
&self,
) -> impl Future<Output = Result<impl Stream<Item = Result<SubspaceId>>>>;
fn import_subspace_secret(
&self,
subspace_secret: SubspaceSecretKey,
) -> impl Future<Output = Result<SubspaceId>>;
fn create_namespace(&self) -> impl Future<Output = Result<NamespaceId>>;
fn list_namespaces(
&self,
) -> impl Future<Output = Result<impl Stream<Item = Result<NamespaceId>>>>;
fn get_namespace_secret(
&self,
namespace: NamespaceId,
) -> impl Future<Output = Result<Option<NamespaceSecretKey>>>;
fn import_namespace_secret(
&self,
secret: [u8; 32],
) -> impl Future<Output = Result<NamespaceId>>;
fn store_blob(
&self,
data: &[u8],
link: &ExactLink,
entity_snapshot_id: Digest,
) -> impl Future<Output = Result<Digest>>;
fn del_blobs(
&self,
link: &ExactLink,
entity_snapshot_id: Digest,
) -> impl Future<Output = Result<usize>>;
fn get_blob(&self, digest: Digest) -> impl Future<Output = Result<Vec<u8>>>;
fn store_entity(
&self,
link: &ExactLink,
data: Vec<u8>,
) -> impl Future<Output = Result<Digest>>;
fn del_entity(&self, link: &ExactLink) -> impl Future<Output = Result<()>>;
fn get_entity(
&self,
link: &ExactLink,
) -> impl Future<Output = Result<Option<Digest>>>;
fn list(
&self,
link: ExactLink,
limit: Option<u64>,
offset: Option<u64>,
) -> impl Future<Output = Result<impl Stream<Item = Result<ExactLink>>>>;
}
Required Methods§
Sourcefn key_resolvers(
&self,
) -> Box<dyn Iterator<Item = &dyn KeyResolverImpl<Digest>> + '_>
fn key_resolvers( &self, ) -> Box<dyn Iterator<Item = &dyn KeyResolverImpl<Digest>> + '_>
Get an iterator over key resolver algorithms implemented by this backend.
Sourcefn encryption_algorithms(
&self,
) -> Box<dyn Iterator<Item = &dyn EncryptionAlgorithmImpl<Digest>> + '_>
fn encryption_algorithms( &self, ) -> Box<dyn Iterator<Item = &dyn EncryptionAlgorithmImpl<Digest>> + '_>
Get an iterator over encryption algorithms implemented by this backend.
fn create_subspace(&self) -> impl Future<Output = Result<SubspaceId>>
fn get_subspace_secret( &self, subspace: SubspaceId, ) -> impl Future<Output = Result<Option<SubspaceSecretKey>>>
fn list_subspaces( &self, ) -> impl Future<Output = Result<impl Stream<Item = Result<SubspaceId>>>>
fn import_subspace_secret( &self, subspace_secret: SubspaceSecretKey, ) -> impl Future<Output = Result<SubspaceId>>
fn create_namespace(&self) -> impl Future<Output = Result<NamespaceId>>
fn list_namespaces( &self, ) -> impl Future<Output = Result<impl Stream<Item = Result<NamespaceId>>>>
fn get_namespace_secret( &self, namespace: NamespaceId, ) -> impl Future<Output = Result<Option<NamespaceSecretKey>>>
fn import_namespace_secret( &self, secret: [u8; 32], ) -> impl Future<Output = Result<NamespaceId>>
Sourcefn store_blob(
&self,
data: &[u8],
link: &ExactLink,
entity_snapshot_id: Digest,
) -> impl Future<Output = Result<Digest>>
fn store_blob( &self, data: &[u8], link: &ExactLink, entity_snapshot_id: Digest, ) -> impl Future<Output = Result<Digest>>
Store a blob for an entity snapshot.
You must specify a namespace to associate the blob to, an entity path, and an entity snapshot.
You can use the same namespace, entity path, and snapshot to delete the blob pins associated
to it with LeafStore::del_blobs()
.
Sourcefn del_blobs(
&self,
link: &ExactLink,
entity_snapshot_id: Digest,
) -> impl Future<Output = Result<usize>>
fn del_blobs( &self, link: &ExactLink, entity_snapshot_id: Digest, ) -> impl Future<Output = Result<usize>>
Delete a blob. This doesn’t necessarily delete the blob immediately, but it removes the garbage collector pin for the entity snapshot.
Returns the number of blobs deleted.
Sourcefn get_blob(&self, digest: Digest) -> impl Future<Output = Result<Vec<u8>>>
fn get_blob(&self, digest: Digest) -> impl Future<Output = Result<Vec<u8>>>
Get’s a blob from the local store.
fn store_entity( &self, link: &ExactLink, data: Vec<u8>, ) -> impl Future<Output = Result<Digest>>
fn del_entity(&self, link: &ExactLink) -> impl Future<Output = Result<()>>
fn get_entity( &self, link: &ExactLink, ) -> impl Future<Output = Result<Option<Digest>>>
fn list( &self, link: ExactLink, limit: Option<u64>, offset: Option<u64>, ) -> impl Future<Output = Result<impl Stream<Item = Result<ExactLink>>>>
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.