pub struct Storage { /* private fields */ }
Expand description
Save data to a desired storage backend.
Implementations§
source§impl Storage
impl Storage
sourcepub async fn open<Cb>(
create: Cb,
overwrite: bool,
) -> Result<Self, HypercoreError>
pub async fn open<Cb>( create: Cb, overwrite: bool, ) -> Result<Self, HypercoreError>
Create a new instance. Takes a callback to create new storage instances and overwrite flag.
sourcepub async fn new_memory() -> Result<Self, HypercoreError>
pub async fn new_memory() -> Result<Self, HypercoreError>
New storage backed by a RandomAccessMemory
instance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl !RefUnwindSafe for Storage
impl Send for Storage
impl !Sync for Storage
impl Unpin for Storage
impl !UnwindSafe for Storage
Blanket Implementations§
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