pub trait BitswapApiClient: SubscriptionClientT {
// Provided methods
fn bitswap_unstable_get<'life0, 'async_trait>(
&'life0 self,
cid: String,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn bitswap_unstable_stream<'life0, 'async_trait>(
&'life0 self,
cids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<Subscription<StreamEvent>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Client implementation for the BitswapApi RPC API.
Provided Methods§
Sourcefn bitswap_unstable_get<'life0, 'async_trait>(
&'life0 self,
cid: String,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn bitswap_unstable_get<'life0, 'async_trait>(
&'life0 self,
cid: String,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Retrieve indexed transaction data by CID.
Accepts a CIDv1 (base32 multibase-encoded string), extracts the 32-byte hash digest, looks up the indexed transaction, and returns hex-encoded data.
bitswap_v1_get is kept as an alias during the transition to the unstable_ naming and
will be removed once clients migrate.
Sourcefn bitswap_unstable_stream<'life0, 'async_trait>(
&'life0 self,
cids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<Subscription<StreamEvent>, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn bitswap_unstable_stream<'life0, 'async_trait>(
&'life0 self,
cids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<Subscription<StreamEvent>, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Stream chunks as they become available.
Emits one StreamEvent::StreamItem / StreamEvent::StreamItemError event per input
CID, in arrival order (the order in which each CID resolves) — not input order.
Clients correlate each event with its request via the embedded cid. After the last
per-CID event, a single StreamEvent::StreamDone marks end-of-stream. No
streamDone is emitted if the client cancels via the unsubscribe method or disconnects.
Top-level rejections (no events emitted, no subscription opened):
-32801 TooManyCids, -32802 EmptyCids, -32803 DuplicateCids.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.