pub enum NetworkCommand {
SendMessage {
peer_id: PeerId,
message: Message,
response: Sender<NetworkResponse>,
},
SendChatRequest {
peer_id: PeerId,
request: ChatRequest,
response: Sender<NetworkResponse>,
},
GetConnectedPeers {
response: Sender<NetworkResponse>,
},
MailboxPut {
peer_id: PeerId,
recipient: [u8; 32],
message: EncryptedMessage,
response: Sender<NetworkResponse>,
},
MailboxFetch {
peer_id: PeerId,
recipient: [u8; 32],
limit: usize,
response: Sender<NetworkResponse>,
},
MailboxAck {
peer_id: PeerId,
recipient: [u8; 32],
msg_ids: Vec<Uuid>,
response: Sender<NetworkResponse>,
},
StartDhtProviderQuery {
key: RecordKey,
response: Sender<Result<QueryId>>,
},
}Expand description
A command to be sent to the NetworkLayer.
Variants§
SendMessage
Send a chat message to a peer.
Fields
§
response: Sender<NetworkResponse>The channel to send the response on.
SendChatRequest
Send a chat request to a peer.
Fields
§
request: ChatRequestThe request to send.
§
response: Sender<NetworkResponse>The channel to send the response on.
GetConnectedPeers
Get the list of connected peers.
Fields
§
response: Sender<NetworkResponse>The channel to send the response on.
MailboxPut
Put a message into a mailbox.
Fields
§
message: EncryptedMessageThe encrypted message to store.
§
response: Sender<NetworkResponse>The channel to send the response on.
MailboxFetch
Fetch messages from a mailbox.
Fields
§
response: Sender<NetworkResponse>The channel to send the response on.
MailboxAck
Acknowledge the receipt of messages from a mailbox.
Fields
§
response: Sender<NetworkResponse>The channel to send the response on.
StartDhtProviderQuery
Start a Kademlia DHT query to find providers for a key.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NetworkCommand
impl !RefUnwindSafe for NetworkCommand
impl Send for NetworkCommand
impl Sync for NetworkCommand
impl Unpin for NetworkCommand
impl !UnwindSafe for NetworkCommand
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> 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