Struct libipld::mem::MemStore [−][src]
In memory reference store implementation. Is intended for testing.
Implementations
impl<S: StoreParams> MemStore<S>
[src]
pub fn new(network: GlobalStore<S>, cache_size: usize) -> Self
[src]
Creates a new MemStore
.
pub fn evict(&self)
[src]
Evicts blocks from the memstore.
pub fn pinned(&self, cid: &Cid) -> Option<bool>
[src]
Checks if a block is pinned.
Trait Implementations
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: References<S::Codecs>,
[src]
Ipld: References<S::Codecs>,
type Params = S
Store parameters.
type TempPin = TempPin
Temp pin.
fn create_temp_pin(&self) -> Result<Self::TempPin>
[src]
fn temp_pin(&self, tmp: &Self::TempPin, cid: &Cid) -> Result<()>
[src]
fn contains(&self, cid: &Cid) -> Result<bool>
[src]
fn get(&self, cid: &Cid) -> Result<Block<S>>
[src]
fn insert(&self, block: &Block<S>) -> Result<()>
[src]
fn alias<T: AsRef<[u8]> + Send + Sync>(
&self,
alias: T,
cid: Option<&Cid>
) -> Result<()>
[src]
&self,
alias: T,
cid: Option<&Cid>
) -> Result<()>
fn resolve<T: AsRef<[u8]> + Send + Sync>(&self, alias: T) -> Result<Option<Cid>>
[src]
fn reverse_alias(&self, cid: &Cid) -> Result<Option<Vec<Vec<u8>>>>
[src]
fn fetch<'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 sync<'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,
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,
#[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,
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,
pub 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> References<RawCodec> for T
[src]
pub fn references<R, E>(
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
[src]
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,