pub trait Routing: Send + Sync {
// Required methods
fn find_providers<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
options: Option<FindProvidersOptions>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<Provider>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn provide<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
options: Option<ProvideOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_peers<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
options: Option<FindPeersOptions>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<PeerInfo>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
options: Option<GetOptions>,
) -> Pin<Box<dyn Future<Output = Result<Option<RoutingRecord>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: &'life2 [u8],
options: Option<PutOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Routing interface for peer and content discovery
Required Methods§
Sourcefn find_providers<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
options: Option<FindProvidersOptions>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<Provider>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_providers<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
options: Option<FindProvidersOptions>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<Provider>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find providers for a given CID
Sourcefn provide<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
options: Option<ProvideOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn provide<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
options: Option<ProvideOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Announce that this node can provide content for a CID
Sourcefn find_peers<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
options: Option<FindPeersOptions>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<PeerInfo>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_peers<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
options: Option<FindPeersOptions>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<PeerInfo>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find peers in the routing system
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
options: Option<GetOptions>,
) -> Pin<Box<dyn Future<Output = Result<Option<RoutingRecord>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
options: Option<GetOptions>,
) -> Pin<Box<dyn Future<Output = Result<Option<RoutingRecord>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a record from the routing system
Sourcefn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: &'life2 [u8],
options: Option<PutOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: &'life2 [u8],
options: Option<PutOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Put a record into the routing system