Struct ipfs_embed_net::NetworkService[][src]

pub struct NetworkService<P: StoreParams> { /* fields omitted */ }

Implementations

impl<P: StoreParams> NetworkService<P>[src]

pub async fn new<S: BitswapStore<Params = P>>(
    config: NetworkConfig,
    store: S
) -> Result<Self>
[src]

pub fn local_peer_id(&self) -> PeerId[src]

pub async fn listen_on(&self, addr: Multiaddr) -> Result<Multiaddr>[src]

pub fn listeners(&self) -> Vec<Multiaddr>[src]

pub fn add_external_address(&self, addr: Multiaddr)[src]

pub fn external_addresses(&self) -> Vec<AddressRecord>[src]

pub fn add_address(&self, peer: &PeerId, addr: Multiaddr)[src]

pub fn remove_address(&self, peer: &PeerId, addr: &Multiaddr)[src]

pub fn dial(&self, peer: &PeerId) -> Result<()>[src]

pub fn ban(&self, peer: PeerId)[src]

pub fn unban(&self, peer: PeerId)[src]

pub async fn bootstrap(&self, peers: &[(PeerId, Multiaddr)]) -> Result<()>[src]

pub async fn get_record(
    &self,
    key: &Key,
    quorum: Quorum
) -> Result<Vec<PeerRecord>>
[src]

pub async fn put_record(&self, record: Record, quorum: Quorum) -> Result<()>[src]

pub fn subscribe(&self, topic: &str) -> Result<impl Stream<Item = Vec<u8>>>[src]

pub fn publish(&self, topic: &str, msg: Vec<u8>) -> Result<()>[src]

pub fn remove_record(&self, key: &Key)[src]

pub fn get(&self, cid: Cid) -> GetQuery<P>

Notable traits for GetQuery<P>

impl<P: StoreParams> Future for GetQuery<P> type Output = Result<()>;
[src]

pub fn sync(&self, cid: Cid, missing: impl Iterator<Item = Cid>) -> SyncQuery<P>

Notable traits for SyncQuery<P>

impl<P: StoreParams> Future for SyncQuery<P> type Output = Result<()>;
[src]

pub async fn provide(&self, cid: Cid) -> Result<()>[src]

pub fn unprovide(&self, cid: Cid)[src]

pub fn register_metrics(&self, registry: &Registry) -> Result<()>[src]

Trait Implementations

impl<P: Clone + StoreParams> Clone for NetworkService<P>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> References<RawCodec> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,