pub struct Litep2p { /* private fields */ }
Expand description
Litep2p
object.
Implementations§
source§impl Litep2p
impl Litep2p
sourcepub fn local_peer_id(&self) -> &PeerId
pub fn local_peer_id(&self) -> &PeerId
Get local peer ID.
sourcepub fn public_addresses(&self) -> PublicAddresses
pub fn public_addresses(&self) -> PublicAddresses
Get the list of public addresses of the node.
sourcepub fn listen_addresses(&self) -> impl Iterator<Item = &Multiaddr>
pub fn listen_addresses(&self) -> impl Iterator<Item = &Multiaddr>
Get the list of listen addresses of the node.
sourcepub fn bandwidth_sink(&self) -> BandwidthSink
pub fn bandwidth_sink(&self) -> BandwidthSink
Get handle to bandwidth sink.
sourcepub async fn dial_address(&mut self, address: Multiaddr) -> Result<()>
pub async fn dial_address(&mut self, address: Multiaddr) -> Result<()>
Dial address.
sourcepub fn add_known_address(
&mut self,
peer: PeerId,
address: impl Iterator<Item = Multiaddr>,
) -> usize
pub fn add_known_address( &mut self, peer: PeerId, address: impl Iterator<Item = Multiaddr>, ) -> usize
Add one ore more known addresses for peer.
Return value denotes how many addresses were added for the peer. Addresses belonging to disabled/unsupported transports will be ignored.
sourcepub async fn next_event(&mut self) -> Option<Litep2pEvent>
pub async fn next_event(&mut self) -> Option<Litep2pEvent>
Poll next event.
This function must be called in order for litep2p to make progress.
Auto Trait Implementations§
impl Freeze for Litep2p
impl !RefUnwindSafe for Litep2p
impl Send for Litep2p
impl !Sync for Litep2p
impl Unpin for Litep2p
impl !UnwindSafe for Litep2p
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more