Skip to main content

NodeConfig

Struct NodeConfig 

Source
pub struct NodeConfig {
Show 20 fields pub transport_enabled: bool, pub identity: Option<Identity>, pub interfaces: Vec<InterfaceConfig>, pub share_instance: bool, pub instance_name: String, pub shared_instance_port: u16, pub rpc_port: u16, pub cache_dir: Option<PathBuf>, pub management: ManagementConfig, pub probe_port: Option<u16>, pub probe_addrs: Vec<SocketAddr>, pub probe_protocol: ProbeProtocol, pub device: Option<String>, pub hooks: Vec<ParsedHook>, pub discover_interfaces: bool, pub discovery_required_value: Option<u8>, pub respond_to_probes: bool, pub prefer_shorter_path: bool, pub max_paths_per_destination: usize, pub registry: Option<InterfaceRegistry>,
}
Expand description

Top-level node configuration.

Fields§

§transport_enabled: bool§identity: Option<Identity>§interfaces: Vec<InterfaceConfig>

Interface configurations (parsed via registry factories).

§share_instance: bool

Enable shared instance server for local clients (rns-ctl, etc.)

§instance_name: String

Instance name for Unix socket namespace (default: “default”).

§shared_instance_port: u16

Shared instance port for local client connections (default 37428).

§rpc_port: u16

RPC control port (default 37429). Only used when share_instance is true.

§cache_dir: Option<PathBuf>

Cache directory for announce cache. If None, announce caching is disabled.

§management: ManagementConfig

Remote management configuration.

§probe_port: Option<u16>

Port to run the STUN probe server on (for facilitator nodes).

§probe_addrs: Vec<SocketAddr>

Addresses of STUN/RNSP probe servers (tried sequentially with failover).

§probe_protocol: ProbeProtocol

Protocol for endpoint discovery: “rnsp” (default) or “stun”.

§device: Option<String>

Network interface to bind outbound sockets to (e.g. “usb0”).

§hooks: Vec<ParsedHook>

Hook configurations loaded from the config file.

§discover_interfaces: bool

Enable interface discovery.

§discovery_required_value: Option<u8>

Minimum stamp value for accepting discovered interfaces (default: 14).

§respond_to_probes: bool

Respond to probe packets with automatic proof (like Python’s respond_to_probes).

§prefer_shorter_path: bool

Accept an announce with strictly fewer hops even when the random_blob is a duplicate of the existing path entry. Default false preserves Python-compatible anti-replay behaviour.

§max_paths_per_destination: usize

Maximum number of alternative paths stored per destination. Default 1 (single path, backward-compatible).

§registry: Option<InterfaceRegistry>

Custom interface registry. If None, uses InterfaceRegistry::with_builtins().

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InterfaceConfigData for T
where T: Send + 'static,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.