pub struct DefaultStorage { /* private fields */ }Trait Implementations§
Source§impl BlockStore for DefaultStorage
impl BlockStore for DefaultStorage
async fn init(&self) -> Result<(), Error>
Source§async fn contains(&self, cid: &Cid) -> Result<bool, Error>
async fn contains(&self, cid: &Cid) -> Result<bool, Error>
Returns whether a block is present in the blockstore.
Source§async fn get(&self, cid: &Cid) -> Result<Option<Block>, Error>
async fn get(&self, cid: &Cid) -> Result<Option<Block>, Error>
Returns a block from the blockstore.
Source§async fn size(&self, cid: &[Cid]) -> Result<Option<usize>, Error>
async fn size(&self, cid: &[Cid]) -> Result<Option<usize>, Error>
Get the size of a single block
Source§async fn put(&self, block: &Block) -> Result<(Cid, BlockPut), Error>
async fn put(&self, block: &Block) -> Result<(Cid, BlockPut), Error>
Inserts a block in the blockstore.
Source§impl Clone for DefaultStorage
impl Clone for DefaultStorage
Source§impl DataStore for DefaultStorage
impl DataStore for DefaultStorage
async fn init(&self) -> Result<(), Error>
Source§async fn contains(&self, key: &[u8]) -> Result<bool, Error>
async fn contains(&self, key: &[u8]) -> Result<bool, Error>
Checks if a key is present in the datastore.
Source§async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
Returns the value associated with a key from the datastore.
Source§async fn put(&self, key: &[u8], value: &[u8]) -> Result<(), Error>
async fn put(&self, key: &[u8], value: &[u8]) -> Result<(), Error>
Puts the value under the key in the datastore.
Source§impl Debug for DefaultStorage
impl Debug for DefaultStorage
Source§impl Default for DefaultStorage
impl Default for DefaultStorage
Source§impl Lock for DefaultStorage
impl Lock for DefaultStorage
Source§impl PinStore for DefaultStorage
impl PinStore for DefaultStorage
async fn is_pinned(&self, block: &Cid) -> Result<bool, Error>
async fn insert_direct_pin(&self, target: &Cid) -> Result<(), Error>
async fn insert_recursive_pin( &self, target: &Cid, referenced: BoxStream<'_, Result<Cid, IpldRefsError>>, ) -> Result<(), Error>
async fn remove_direct_pin(&self, target: &Cid) -> Result<(), Error>
async fn remove_recursive_pin( &self, target: &Cid, referenced: BoxStream<'_, Result<Cid, IpldRefsError>>, ) -> Result<(), Error>
async fn list( &self, mode: Option<PinMode>, ) -> BoxStream<'static, Result<(Cid, PinMode), Error>>
Source§impl RepoTypes for DefaultStorage
impl RepoTypes for DefaultStorage
Source§type TBlockStore = DefaultStorage
type TBlockStore = DefaultStorage
Describes a blockstore.
Source§type TDataStore = DefaultStorage
type TDataStore = DefaultStorage
Describes a datastore.
type TLock = DefaultStorage
impl Unpin for DefaultStorage
Auto Trait Implementations§
impl Freeze for DefaultStorage
impl !RefUnwindSafe for DefaultStorage
impl Send for DefaultStorage
impl Sync for DefaultStorage
impl UnsafeUnpin for DefaultStorage
impl !UnwindSafe for DefaultStorage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more