Struct mixnet::core::Config

source ·
pub struct Config {
Show 15 fields pub log_target: &'static str, pub num_gateway_mixnodes: u32, pub session_0_kx_secret: Option<KxSecret>, pub mixnode_session: SessionConfig, pub non_mixnode_session: Option<SessionConfig>, pub forward_packet_queue_capacity: usize, pub mean_forwarding_delay: Duration, pub per_hop_net_delay: Duration, pub loop_cover_proportion: f64, pub gen_cover_packets: bool, pub num_hops: usize, pub surb_keystore_capacity: usize, pub max_incomplete_messages: usize, pub max_incomplete_fragments: usize, pub max_fragments_per_message: usize,
}
Expand description

Mixnet configuration.

Fields§

§log_target: &'static str

The target for log messages.

§num_gateway_mixnodes: u32

The number of mixnodes to connect to when we are not a mixnode ourselves. When we are a mixnode, we connect to all other mixnodes.

§session_0_kx_secret: Option<KxSecret>

The key-exchange secret key to use in session 0. This option is intended for testing purposes only.

§mixnode_session: SessionConfig

Used by sessions in which the local node is a mixnode. If this is not the same for all nodes, delay estimates may be off.

§non_mixnode_session: Option<SessionConfig>

Used by sessions in which the local node is not a mixnode. If None, we will only participate in the mixnet during sessions in which we are a mixnode.

§forward_packet_queue_capacity: usize

Maximum number of packets waiting for their forwarding delay to elapse. When at the limit, any packets arriving that need forwarding will simply be dropped.

§mean_forwarding_delay: Duration

Mean forwarding delay at each mixnode. This should really be the same for all nodes!

§per_hop_net_delay: Duration

Conservative estimate of the network (and processing) delay per hop.

§loop_cover_proportion: f64

Proportion of authored packets which should be loop cover packets (as opposed to drop cover packets or real packets). If this is not the same for all nodes, delay estimates may be off.

§gen_cover_packets: bool

Generate cover packets? This option is intended for testing purposes only. It essentially just drops all cover packets instead of sending them.

§num_hops: usize

Number of hops for packets to traverse. Some packets may traverse more hops if necessary. Note this only affects packets whose headers are generated by this node. Must be <= MAX_HOPS.

§surb_keystore_capacity: usize

Maximum number of outstanding SURBs to keep keys for. Must be greater than 0.

§max_incomplete_messages: usize

Maximum number of incomplete messages to keep.

§max_incomplete_fragments: usize

Maximum number of fragments to keep across all incomplete messages.

§max_fragments_per_message: usize

Maximum number of fragments per message. This should really be the same for all nodes!

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V