[][src]Trait ipfs_embed_core::Network

pub trait Network<S: StoreParams>: Send + Sync + 'static {
    type Subscription: Stream<Item = NetworkEvent> + Send + Unpin;
    fn local_peer_id(&self) -> &PeerId;
fn external_addresses(&self) -> Vec<Multiaddr>;
fn providers(&self, cid: &Cid);
fn provide(&self, cid: &Cid);
fn unprovide(&self, cid: &Cid);
fn connect(&self, peer_id: PeerId);
fn want(&self, cid: Cid, priority: i32);
fn cancel(&self, cid: Cid);
fn send_to(&self, peer_id: PeerId, cid: Cid, data: Vec<u8>);
fn send(&self, cid: Cid, data: Vec<u8>);
fn subscribe(&self) -> Self::Subscription; }

Associated Types

Loading content...

Required methods

fn local_peer_id(&self) -> &PeerId

fn external_addresses(&self) -> Vec<Multiaddr>

fn providers(&self, cid: &Cid)

fn provide(&self, cid: &Cid)

fn unprovide(&self, cid: &Cid)

fn connect(&self, peer_id: PeerId)

fn want(&self, cid: Cid, priority: i32)

fn cancel(&self, cid: Cid)

fn send_to(&self, peer_id: PeerId, cid: Cid, data: Vec<u8>)

fn send(&self, cid: Cid, data: Vec<u8>)

fn subscribe(&self) -> Self::Subscription

Loading content...

Implementors

Loading content...