pub struct NetworkClient { /* private fields */ }Implementations§
Source§impl NetworkClient
impl NetworkClient
pub const fn new(network_manager: LazyRecipient<NetworkMessage>) -> Self
pub async fn dial(&self, peer_addr: Multiaddr) -> Result<()>
pub async fn listen_on(&self, addr: Multiaddr) -> Result<()>
pub async fn bootstrap(&self) -> Result<()>
pub async fn subscribe(&self, topic: IdentTopic) -> Result<IdentTopic>
pub async fn unsubscribe(&self, topic: IdentTopic) -> Result<IdentTopic>
pub async fn publish( &self, topic: TopicHash, data: Vec<u8>, ) -> Result<MessageId>
pub async fn open_stream(&self, peer_id: PeerId) -> Result<Stream>
pub async fn peer_count(&self) -> usize
pub async fn mesh_peer_count(&self, topic: TopicHash) -> usize
pub async fn mesh_peers(&self, topic: TopicHash) -> Vec<PeerId>
Sourcepub async fn announce_blob(
&self,
blob_id: BlobId,
context_id: ContextId,
size: u64,
) -> Result<()>
pub async fn announce_blob( &self, blob_id: BlobId, context_id: ContextId, size: u64, ) -> Result<()>
Announce a blob to the DHT for a specific context
Trait Implementations§
Source§impl Clone for NetworkClient
impl Clone for NetworkClient
Source§fn clone(&self) -> NetworkClient
fn clone(&self) -> NetworkClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NetworkClient
impl !RefUnwindSafe for NetworkClient
impl Send for NetworkClient
impl Sync for NetworkClient
impl Unpin for NetworkClient
impl !UnwindSafe for NetworkClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more