Trait NetworkZone

Source
pub trait NetworkZone:
    Clone
    + Copy
    + Send
    + 'static {
    type Addr: NetZoneAddress;

    const NAME: &'static str;
    const CHECK_NODE_ID: bool;
    const BROADCAST_OWN_ADDR: bool;
}
Expand description

An abstraction over a network zone (tor/i2p/clear)

Required Associated Constants§

Source

const NAME: &'static str

The network name.

Source

const CHECK_NODE_ID: bool

Check if our node ID matches the incoming peers node ID for this network.

This has privacy implications on an anonymity network if true so should be set to false.

Source

const BROADCAST_OWN_ADDR: bool

If true, this network zone requires us to blend our own address and port into the address book we plan on sharing to other peers.

Required Associated Types§

Source

type Addr: NetZoneAddress

The address type of this network.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl NetworkZone for ClearNet

Source§

const NAME: &'static str = "ClearNet"

Source§

const CHECK_NODE_ID: bool = true

Source§

const BROADCAST_OWN_ADDR: bool = false

Source§

type Addr = SocketAddr

impl<const CHECK_NODE_ID: bool> NetworkZone for TestNetZone<CHECK_NODE_ID>