[−][src]Struct libipld::mem::MemStore
A memory backed store
Implementations
impl<S: StoreParams> MemStore<S> where
Ipld: Decode<S::Codecs>,
[src]
Ipld: Decode<S::Codecs>,
pub fn new(global: Arc<GlobalStore<S>>) -> Self
[src]
Create a new empty MemStore
pub async fn blocks<'_>(&'_ self) -> Vec<Cid>
[src]
Returns a vec of all cid's in the store.
pub async fn status<'_, '_>(&'_ self, cid: &'_ Cid) -> Option<Status>
[src]
Returns the status of a block.
pub async fn info<'a>(&'a self, cid: &'a Cid) -> Option<BlockInfo<S>>
[src]
Returns the block info.
Trait Implementations
impl<S: StoreParams> AliasStore for MemStore<S> where
Ipld: Decode<S::Codecs>,
[src]
Ipld: Decode<S::Codecs>,
fn alias<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
alias: &'life1 [u8],
cid: &'life2 Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
alias: &'life1 [u8],
cid: &'life2 Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn unalias<'life0, 'life1, 'async_trait>(
&'life0 self,
alias: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
alias: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
alias: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Option<Cid>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
alias: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Option<Cid>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
impl<S: Clone + StoreParams> Clone for MemStore<S>
[src]
impl<S: StoreParams> Default for MemStore<S>
[src]
impl<S: StoreParams> Store for MemStore<S> where
Ipld: Decode<S::Codecs>,
[src]
Ipld: Decode<S::Codecs>,
type Params = S
Store parameters.
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<Block<S>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<Block<S>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn commit<'life0, 'async_trait>(
&'life0 self,
tx: Transaction<S>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
tx: Transaction<S>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
#[must_use]fn insert<'life0, 'async_trait>(
&'life0 self,
block: Block<Self::Params>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
block: Block<Self::Params>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
'life0: 'async_trait,
Self: 'async_trait,
#[must_use]fn unpin<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
#[must_use]fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 DagPath<'life2>
) -> Pin<Box<dyn Future<Output = Result<Ipld>> + Send + 'async_trait>> where
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
path: &'life1 DagPath<'life2>
) -> Pin<Box<dyn Future<Output = Result<Ipld>> + Send + 'async_trait>> where
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
#[must_use]fn sync<'life0, 'async_trait>(
&'life0 self,
old: Option<Cid>,
new: Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
old: Option<Cid>,
new: Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
'life0: 'async_trait,
Self: 'async_trait,
#[must_use]fn flush<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl<S> !RefUnwindSafe for MemStore<S>
impl<S> Send for MemStore<S>
impl<S> Sync for MemStore<S>
impl<S> Unpin for MemStore<S>
impl<S> !UnwindSafe for MemStore<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,