[][src]Struct ipfs_embed::NetworkConfig

pub struct NetworkConfig {
    pub listen_addresses: Vec<Multiaddr>,
    pub public_addresses: Vec<Multiaddr>,
    pub boot_nodes: Vec<(Multiaddr, PeerId)>,
    pub node_key: Keypair,
    pub node_name: String,
    pub enable_mdns: bool,
    pub enable_ping: bool,
    pub allow_non_globals_in_dht: bool,
}

Network configuration.

Fields

listen_addresses: Vec<Multiaddr>

Multiaddresses to listen for incoming connections.

public_addresses: Vec<Multiaddr>

Multiaddresses to advertise. Detected automatically if empty.

boot_nodes: Vec<(Multiaddr, PeerId)>

List of initial node addresses.

node_key: Keypair

Node identity keypair.

node_name: String

Name of the node. Sent over the wire for debugging purposes.

enable_mdns: bool

Enable mdns.

enable_ping: bool

Enable ping.

allow_non_globals_in_dht: bool

Should we insert non-global addresses into the DHT?

Implementations

impl NetworkConfig[src]

pub fn new() -> Self[src]

Creates a new network configuration.

pub fn new_local() -> Self[src]

Creates a new local network configuration.

pub fn public(&self) -> PublicKey[src]

The public node key.

pub fn peer_id(&self) -> PeerId[src]

The peer id of the node.

Trait Implementations

impl Clone for NetworkConfig[src]

impl Default for NetworkConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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