pub struct NetCryptoNewArgs {
pub udp_tx: Sender<(Packet, SocketAddr)>,
pub lossless_tx: UnboundedSender<(PublicKey, Vec<u8>)>,
pub lossy_tx: UnboundedSender<(PublicKey, Vec<u8>)>,
pub dht_pk: PublicKey,
pub dht_sk: SecretKey,
pub real_pk: PublicKey,
pub real_sk: SecretKey,
pub precomputed_keys: PrecomputedCache,
}
Expand description
Arguments for creating new NetCrypto
.
Fields§
§udp_tx: Sender<(Packet, SocketAddr)>
Sink to send packets to UDP socket.
lossless_tx: UnboundedSender<(PublicKey, Vec<u8>)>
Sink to send lossless packets. The key is a long term public key of the peer that sent this packet.
lossy_tx: UnboundedSender<(PublicKey, Vec<u8>)>
Sink to send lossy packets. The key is a long term public key of the peer that sent this packet.
dht_pk: PublicKey
Our DHT PublicKey
dht_sk: SecretKey
Our DHT SecretKey
real_pk: PublicKey
Our real PublicKey
real_sk: SecretKey
Our real SecretKey
precomputed_keys: PrecomputedCache
Lru cache for precomputed keys. It stores precomputed keys to avoid redundant calculations.
Trait Implementations§
Source§impl Clone for NetCryptoNewArgs
impl Clone for NetCryptoNewArgs
Source§fn clone(&self) -> NetCryptoNewArgs
fn clone(&self) -> NetCryptoNewArgs
Returns a copy 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 NetCryptoNewArgs
impl !RefUnwindSafe for NetCryptoNewArgs
impl Send for NetCryptoNewArgs
impl Sync for NetCryptoNewArgs
impl Unpin for NetCryptoNewArgs
impl !UnwindSafe for NetCryptoNewArgs
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> 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