Struct ipfs_embed_net::NetworkService [−][src]
Implementations
impl<P: StoreParams> NetworkService<P>
[src]
pub async fn new<S: BitswapStore<Params = P>>(
config: NetworkConfig,
store: S
) -> Result<Self>
[src]
config: NetworkConfig,
store: S
) -> Result<Self>
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]
&self,
key: &Key,
quorum: Quorum
) -> Result<Vec<PeerRecord>>
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>ⓘ
[src]
pub fn sync(&self, cid: Cid, missing: impl Iterator<Item = Cid>) -> SyncQuery<P>ⓘ
[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]
fn clone(&self) -> NetworkService<P>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for NetworkService<P>
[src]
impl<P> Send for NetworkService<P>
[src]
impl<P> Sync for NetworkService<P>
[src]
impl<P> Unpin for NetworkService<P>
[src]
impl<P> UnwindSafe for NetworkService<P>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> References<RawCodec> for T
pub fn references<R, E>(
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,