pub struct Blobs<T, S>where
S: Store,{ /* private fields */ }Expand description
Blobs service offering storage, retrieval and synchronisation of content-addressed data.
Implementations§
Source§impl<T, S> Blobs<T, S>
impl<T, S> Blobs<T, S>
Sourcepub async fn from_builder(
network_builder: NetworkBuilder<T>,
store: S,
) -> Result<(Network<T>, Self)>
pub async fn from_builder( network_builder: NetworkBuilder<T>, store: S, ) -> Result<(Network<T>, Self)>
Returns a new instance of Blobs using the given NetworkBuilder and store
implementation.
Sourcepub async fn from_builder_with_config(
network_builder: NetworkBuilder<T>,
store: S,
config: Config,
) -> Result<(Network<T>, Self)>
pub async fn from_builder_with_config( network_builder: NetworkBuilder<T>, store: S, config: Config, ) -> Result<(Network<T>, Self)>
Returns a new instance of Blobs using the given NetworkBuilder, store
implementation and configuration.
Sourcepub async fn get(&self, hash: Hash) -> Result<Option<<S as Map>::Entry>>
pub async fn get(&self, hash: Hash) -> Result<Option<<S as Map>::Entry>>
Get an entry for a hash.
The entry provides access to metadata and methods for retrieving the actual blob data.
Sourcepub async fn import_blob(
&self,
path: PathBuf,
) -> impl Stream<Item = ImportBlobEvent>
pub async fn import_blob( &self, path: PathBuf, ) -> impl Stream<Item = ImportBlobEvent>
Import a blob from the given path.
Sourcepub async fn import_blob_from_stream<D>(
&self,
data: D,
) -> impl Stream<Item = ImportBlobEvent>
pub async fn import_blob_from_stream<D>( &self, data: D, ) -> impl Stream<Item = ImportBlobEvent>
Import a blob from the given stream.
Sourcepub async fn download_blob(
&self,
hash: Hash,
) -> impl Stream<Item = DownloadBlobEvent>
pub async fn download_blob( &self, hash: Hash, ) -> impl Stream<Item = DownloadBlobEvent>
Download a blob from a network peer.
Trait Implementations§
Auto Trait Implementations§
impl<T, S> Freeze for Blobs<T, S>where
S: Freeze,
impl<T, S> !RefUnwindSafe for Blobs<T, S>
impl<T, S> Send for Blobs<T, S>where
T: Send,
impl<T, S> Sync for Blobs<T, S>where
T: Send,
impl<T, S> Unpin for Blobs<T, S>where
S: Unpin,
impl<T, S> !UnwindSafe for Blobs<T, S>
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