pub struct Traffic {
pub average_packet_delay: Duration,
pub message_sending_average_delay: Duration,
pub disable_main_poisson_packet_distribution: bool,
pub deterministic_route_selection: bool,
pub maximum_number_of_retransmissions: Option<u32>,
pub primary_packet_size: PacketSize,
pub secondary_packet_size: Option<PacketSize>,
pub use_legacy_sphinx_format: bool,
pub packet_type: PacketType,
pub disable_mix_hops: bool,
}Fields§
§average_packet_delay: DurationThe parameter of Poisson distribution determining how long, on average, sent packet is going to be delayed at any given mix node. So for a packet going through three mix nodes, on average, it will take three times this value until the packet reaches its destination.
message_sending_average_delay: DurationThe parameter of Poisson distribution determining how long, on average, it is going to take another ‘real traffic stream’ message to be sent. If no real packets are available and cover traffic is enabled, a loop cover message is sent instead in order to preserve the rate.
disable_main_poisson_packet_distribution: boolControls whether the main packet stream constantly produces packets according to the predefined poisson distribution.
deterministic_route_selection: boolSpecify whether route selection should be determined by the packet header.
maximum_number_of_retransmissions: Option<u32>Specify how many times particular packet can be retransmitted None - no limit
primary_packet_size: PacketSizeSpecifies the packet size used for sent messages. Do not override it unless you understand the consequences of that change.
secondary_packet_size: Option<PacketSize>Specifies the optional auxiliary packet size for optimizing message streams. Note that its use decreases overall anonymity. Do not set it unless you understand the consequences of that change.
use_legacy_sphinx_format: boolSpecify whether any constructed sphinx packets should use the legacy format, where the payload keys are explicitly attached rather than using the seeds this affects any forward packets, acks and reply surbs this flag should remain disabled until sufficient number of nodes on the network has upgraded and support updated format. in the case of reply surbs, the recipient must also understand the new encoding
packet_type: PacketType§disable_mix_hops: boolIndicates whether to mix hops or not. If mix hops are enabled, traffic will be routed as usual, to the entry gateway, through three mix nodes, egressing through the exit gateway. If mix hops are disabled, traffic will be routed directly from the entry gateway to the exit gateway, bypassing the mix nodes.
This overrides the use_legacy_sphinx_format setting as reduced mix hops
requires use of the updated SURB packet format.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Traffic
impl<'de> Deserialize<'de> for Traffic
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Traffic, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Traffic, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Traffic
impl Serialize for Traffic
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Traffic
impl StructuralPartialEq for Traffic
Auto Trait Implementations§
impl Freeze for Traffic
impl RefUnwindSafe for Traffic
impl Send for Traffic
impl Sync for Traffic
impl Unpin for Traffic
impl UnwindSafe for Traffic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Deprecatable for T
impl<T> Deprecatable for T
fn deprecate(self) -> Deprecated<Self>where
Self: Sized,
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>
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>
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 moreSource§impl<T> OptionalSet for T
impl<T> OptionalSet for T
Source§fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
Some), the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_validated_optional<F, T, V, E>(
self,
f: F,
value: Option<T>,
validate: V,
) -> Result<Self, E>
fn with_validated_optional<F, T, V, E>( self, f: F, value: Option<T>, validate: V, ) -> Result<Self, E>
Some) it is validated and then the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the FromStr implementation and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.Source§fn with_optional_custom_env<F, T, G>(
self,
f: F,
val: Option<T>,
env_var: &str,
parser: G,
) -> Self
fn with_optional_custom_env<F, T, G>( self, f: F, val: Option<T>, env_var: &str, parser: G, ) -> Self
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the provided parser and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.