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
Sourcepub async fn query_blob(
&self,
blob_id: BlobId,
context_id: Option<ContextId>,
) -> Result<Vec<PeerId>>
pub async fn query_blob( &self, blob_id: BlobId, context_id: Option<ContextId>, ) -> Result<Vec<PeerId>>
Query the DHT for peers that have a specific blob
Sourcepub async fn request_blob(
&self,
blob_id: BlobId,
context_id: ContextId,
peer_id: PeerId,
auth: Option<BlobAuth>,
) -> Result<Option<Vec<u8>>>
pub async fn request_blob( &self, blob_id: BlobId, context_id: ContextId, peer_id: PeerId, auth: Option<BlobAuth>, ) -> Result<Option<Vec<u8>>>
Request a blob from a specific peer
Sourcepub async fn send_specialized_node_verification_request(
&self,
peer_id: PeerId,
request: VerificationRequest,
) -> Result<OutboundRequestId>
pub async fn send_specialized_node_verification_request( &self, peer_id: PeerId, request: VerificationRequest, ) -> Result<OutboundRequestId>
Send a specialized node verification request to a peer
Sourcepub async fn send_specialized_node_invitation_response(
&self,
channel: ResponseChannel<SpecializedNodeInvitationResponse>,
response: SpecializedNodeInvitationResponse,
) -> Result<()>
pub async fn send_specialized_node_invitation_response( &self, channel: ResponseChannel<SpecializedNodeInvitationResponse>, response: SpecializedNodeInvitationResponse, ) -> Result<()>
Send a specialized node invitation response via the response channel
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 (const: unstable) · 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 !RefUnwindSafe for NetworkClient
impl !UnwindSafe for NetworkClient
impl Freeze for NetworkClient
impl Send for NetworkClient
impl Sync for NetworkClient
impl Unpin for NetworkClient
impl UnsafeUnpin 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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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