[−][src]Trait ipfs_embed::WritableStore
Implementable by ipld storage backends.
Required methods
fn insert(
&'a self,
block: &'a Block<Self::Codec, Self::Multihash>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
&'a self,
block: &'a Block<Self::Codec, Self::Multihash>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
Inserts and pins block into the store and announces it if it is visible.
If the block is larger than MAX_BLOCK_SIZE
it returns a BlockTooLarge
error.
fn insert_batch(
&'a self,
batch: &'a [Block<Self::Codec, Self::Multihash>]
) -> Pin<Box<dyn Future<Output = Result<Cid, Error>> + 'a + Send>>
&'a self,
batch: &'a [Block<Self::Codec, Self::Multihash>]
) -> Pin<Box<dyn Future<Output = Result<Cid, Error>> + 'a + Send>>
Inserts a batch of blocks atomically into the store and announces them block if it is visible. The last block is pinned.
If the block is larger than MAX_BLOCK_SIZE
it returns a BlockTooLarge
error.
If the batch is empty it returns an EmptyBatch
error.
fn flush(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>
Flushes the write buffer.
fn unpin(
&'a self,
cid: &'a Cid
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
&'a self,
cid: &'a Cid
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
Decreases the ref count on a cid.
Implementations on Foreign Types
impl<C, M> Store for MemStore<C, M> where
C: Codec,
M: MultihashDigest,
[src]
C: Codec,
M: MultihashDigest,
fn insert(
&'a self,
block: &'a Block<C, M>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
[src]
&'a self,
block: &'a Block<C, M>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
fn insert_batch(
&'a self,
batch: &'a [Block<C, M>]
) -> Pin<Box<dyn Future<Output = Result<Cid, Error>> + 'a + Send>>
[src]
&'a self,
batch: &'a [Block<C, M>]
) -> Pin<Box<dyn Future<Output = Result<Cid, Error>> + 'a + Send>>
fn flush(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>
[src]
fn unpin(
&'a self,
cid: &'a Cid
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>
[src]
&'a self,
cid: &'a Cid
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'a + Send>>