[−][src]Struct tox_core::onion::client::OnionClient
Onion client that is responsible for announcing our DHT PublicKey
to our
friends and looking for their DHT PublicKey
s.
Implementations
impl OnionClient
[src]
pub fn new(
dht: DhtServer,
tcp_connections: TcpConnections,
real_sk: SecretKey,
real_pk: PublicKey
) -> Self
[src]
dht: DhtServer,
tcp_connections: TcpConnections,
real_sk: SecretKey,
real_pk: PublicKey
) -> Self
Create new OnionClient
.
pub async fn set_dht_pk_sink(
&self,
dht_pk_tx: UnboundedSender<(PublicKey, PublicKey)>
)
[src]
&self,
dht_pk_tx: UnboundedSender<(PublicKey, PublicKey)>
)
Set sink to send DHT PublicKey
when it gets known.
pub async fn set_friend_request_sink(
&self,
friend_request_sink: UnboundedSender<(PublicKey, FriendRequest)>
)
[src]
&self,
friend_request_sink: UnboundedSender<(PublicKey, FriendRequest)>
)
Set sink to receive FriendRequest
s.
pub async fn handle_announce_response(
&self,
packet: &OnionAnnounceResponse,
is_global: bool
) -> Result<(), HandleAnnounceResponseError>
[src]
&self,
packet: &OnionAnnounceResponse,
is_global: bool
) -> Result<(), HandleAnnounceResponseError>
Handle OnionAnnounceResponse
packet.
pub async fn handle_dht_pk_announce(
&self,
friend_pk: PublicKey,
dht_pk_announce: DhtPkAnnouncePayload
) -> Result<(), HandleDhtPkAnnounceError>
[src]
&self,
friend_pk: PublicKey,
dht_pk_announce: DhtPkAnnouncePayload
) -> Result<(), HandleDhtPkAnnounceError>
Handle DHT PublicKey
announce from both onion and DHT.
pub async fn handle_data_response(
&self,
packet: &OnionDataResponse
) -> Result<(), HandleDataResponseError>
[src]
&self,
packet: &OnionDataResponse
) -> Result<(), HandleDataResponseError>
Handle OnionDataResponse
packet.
pub async fn add_path_node(&self, node: PackedNode)
[src]
Add new node to random nodes pool to use them to build random paths.
pub async fn add_friend(&self, real_pk: PublicKey)
[src]
Add a friend to start looking for its DHT PublicKey
.
pub async fn remove_friend(&self, real_pk: PublicKey)
[src]
Remove a friend and stop looking for him.
pub async fn set_friend_connected(&self, real_pk: PublicKey, connected: bool)
[src]
Set connection status of a friend. If he's connected we can stop looking
for his DHT PublicKey
.
pub async fn set_friend_dht_pk(&self, real_pk: PublicKey, dht_pk: PublicKey)
[src]
Set friend's DHT PublicKey
when it gets known somewhere else.
pub async fn run(&self) -> Result<(), RunError>
[src]
Run periodical announcements and friends searching.
Trait Implementations
impl Clone for OnionClient
[src]
pub fn clone(&self) -> OnionClient
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for OnionClient
[src]
impl Send for OnionClient
[src]
impl Sync for OnionClient
[src]
impl Unpin for OnionClient
[src]
impl !UnwindSafe for OnionClient
[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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,