[−][src]Struct ipld_block_builder::GenericBlockBuilder
Generic block builder for creating blocks.
Implementations
impl<S, H: Multihasher<Code>, C: Codec> GenericBlockBuilder<S, H, C>[src]
impl<S: ReadonlyStore, H: Multihasher<Code>, C: Codec> GenericBlockBuilder<S, H, C>[src]
pub async fn get<'_, '_, D: Decode<C>>(&'_ self, cid: &'_ Cid) -> Result<D>[src]
Returns the decoded block with cid.
pub async fn get_ipld<'_, '_>(&'_ self, cid: &'_ Cid) -> Result<Ipld>[src]
Returns the ipld representation of a block with cid.
pub async fn get_path<'_, '_, '_>(
&'_ self,
path: &'_ DagPath<'_>
) -> Result<Ipld>[src]
&'_ self,
path: &'_ DagPath<'_>
) -> Result<Ipld>
Resolves a path recursively and returns the ipld.
impl<S: Store, H: Multihasher<Code>, C: Codec> GenericBlockBuilder<S, H, C>[src]
pub async fn insert<'_, '_, E: Encode<C>>(&'_ self, e: &'_ E) -> Result<Cid>[src]
Encodes and inserts a block into the store.
pub async fn flush<'_>(&'_ self) -> Result<()>[src]
Flushes the store to disk.
pub async fn unpin<'_, '_>(&'_ self, cid: &'_ Cid) -> Result<()>[src]
Unpins a block from the store marking it ready for garbage collection.
impl<S: MultiUserStore, H: Multihasher<Code>, C: Codec> GenericBlockBuilder<S, H, C>[src]
pub async fn pin<'_, '_, '_>(
&'_ self,
cid: &'_ Cid,
path: &'_ Path
) -> Result<()>[src]
&'_ self,
cid: &'_ Cid,
path: &'_ Path
) -> Result<()>
Pins a block in the store.
impl<S: AliasStore, H: Multihasher<Code>, C: Codec> GenericBlockBuilder<S, H, C>[src]
pub async fn alias<'_, '_, '_>(
&'_ self,
alias: &'_ [u8],
cid: &'_ Cid
) -> Result<()>[src]
&'_ self,
alias: &'_ [u8],
cid: &'_ Cid
) -> Result<()>
Creates an alias for a cid.
pub async fn unalias<'_, '_>(&'_ self, alias: &'_ [u8]) -> Result<()>[src]
Removes an alias.
pub async fn resolve<'_, '_>(&'_ self, alias: &'_ [u8]) -> Result<Option<Cid>>[src]
Resolves an alias.
Trait Implementations
impl<S, H: Multihasher<Code>, C: Codec> Deref for GenericBlockBuilder<S, H, C>[src]
impl<S, H: Multihasher<Code>, C: Codec> DerefMut for GenericBlockBuilder<S, H, C>[src]
Auto Trait Implementations
impl<S, H, C> RefUnwindSafe for GenericBlockBuilder<S, H, C> where
C: RefUnwindSafe,
H: RefUnwindSafe,
S: RefUnwindSafe,
C: RefUnwindSafe,
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, H, C> Send for GenericBlockBuilder<S, H, C> where
C: Send,
H: Send,
S: Send,
C: Send,
H: Send,
S: Send,
impl<S, H, C> Sync for GenericBlockBuilder<S, H, C> where
C: Sync,
H: Sync,
S: Sync,
C: Sync,
H: Sync,
S: Sync,
impl<S, H, C> Unpin for GenericBlockBuilder<S, H, C> where
C: Unpin,
H: Unpin,
S: Unpin,
C: Unpin,
H: Unpin,
S: Unpin,
impl<S, H, C> UnwindSafe for GenericBlockBuilder<S, H, C> where
C: UnwindSafe,
H: UnwindSafe,
S: UnwindSafe,
C: UnwindSafe,
H: UnwindSafe,
S: UnwindSafe,
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, 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>,