Struct hermes_ipfs::HermesIpfs
source · pub struct HermesIpfs {
pub(crate) node: Ipfs,
}
Expand description
Hermes IPFS Node.
Fields§
§node: Ipfs
IPFS node
Implementations§
source§impl HermesIpfs
impl HermesIpfs
sourcepub async fn add_ipfs_file(&self, ipfs_file: AddIpfsFile) -> Result<IpfsPath>
pub async fn add_ipfs_file(&self, ipfs_file: AddIpfsFile) -> Result<IpfsPath>
sourcepub async fn get_ipfs_file(&self, ipfs_path: GetIpfsFile) -> Result<Vec<u8>>
pub async fn get_ipfs_file(&self, ipfs_path: GetIpfsFile) -> Result<Vec<u8>>
sourcepub async fn insert_pin(&self, cid: &Cid) -> Result<()>
pub async fn insert_pin(&self, cid: &Cid) -> Result<()>
sourcepub async fn is_pinned(&self, cid: &Cid) -> Result<bool>
pub async fn is_pinned(&self, cid: &Cid) -> Result<bool>
Checks whether a given block is pinned.
§Crash unsafety
Cannot currently detect partially written recursive pins. Those can happen if
HermesIpfs::insert_pin
is interrupted by a crash for example.
Works correctly only under no-crash situations. Workaround for hitting a crash is to re-pin any existing recursive pins.
§Parameters
cid
-Cid
Content identifier to be pinned.
§Returns
true
if the block is pinned, false
if not. See Crash unsafety notes for the
false response.
§Errors
Returns an error if checking pin fails.
sourcepub async fn remove_pin(&self, cid: &Cid) -> Result<()>
pub async fn remove_pin(&self, cid: &Cid) -> Result<()>
sourcepub async fn listening_addresses(&self) -> Result<Vec<Multiaddr>>
pub async fn listening_addresses(&self) -> Result<Vec<Multiaddr>>
sourcepub async fn dht_put(
&self,
key: impl AsRef<[u8]>,
value: impl Into<Vec<u8>>,
) -> Result<()>
pub async fn dht_put( &self, key: impl AsRef<[u8]>, value: impl Into<Vec<u8>>, ) -> Result<()>
sourcepub async fn add_bootstrap(&self, address: Multiaddr) -> Result<Multiaddr>
pub async fn add_bootstrap(&self, address: Multiaddr) -> Result<Multiaddr>
sourcepub async fn pubsub_events(
&self,
topic: impl Into<String>,
) -> Result<BoxStream<'static, PubsubEvent>>
pub async fn pubsub_events( &self, topic: impl Into<String>, ) -> Result<BoxStream<'static, PubsubEvent>>
sourcepub async fn pubsub_subscribe(
&self,
topic: impl Into<String>,
) -> Result<SubscriptionStream>
pub async fn pubsub_subscribe( &self, topic: impl Into<String>, ) -> Result<SubscriptionStream>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HermesIpfs
impl !RefUnwindSafe for HermesIpfs
impl Send for HermesIpfs
impl Sync for HermesIpfs
impl Unpin for HermesIpfs
impl !UnwindSafe for HermesIpfs
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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