pub struct EthernetConfig {
pub interface: String,
pub ethertype: Option<u16>,
pub mtu: Option<u16>,
pub recv_buf_size: Option<usize>,
pub send_buf_size: Option<usize>,
pub discovery: Option<bool>,
pub announce: Option<bool>,
pub auto_connect: Option<bool>,
pub accept_connections: Option<bool>,
pub beacon_interval_secs: Option<u64>,
}Expand description
Ethernet transport instance configuration.
EthernetConfig is always compiled (for config parsing on any platform), but the transport runtime currently requires Linux or macOS raw sockets.
Fields§
§interface: StringNetwork interface name (e.g., “eth0”, “enp3s0”). Required.
ethertype: Option<u16>Custom EtherType (default: 0x2121).
mtu: Option<u16>MTU override. Defaults to the interface’s MTU minus 1 (for frame type prefix). Cannot exceed the interface’s actual MTU.
recv_buf_size: Option<usize>Receive buffer size in bytes. Default: 2 MB.
send_buf_size: Option<usize>Send buffer size in bytes. Default: 2 MB.
discovery: Option<bool>Listen for discovery beacons from other nodes. Default: true.
announce: Option<bool>Broadcast announcement beacons on the LAN. Default: false.
auto_connect: Option<bool>Auto-connect to discovered peers. Default: false.
accept_connections: Option<bool>Accept incoming connection attempts. Default: false.
beacon_interval_secs: Option<u64>Announcement beacon interval in seconds. Default: 30.
Implementations§
Source§impl EthernetConfig
impl EthernetConfig
Sourcepub fn recv_buf_size(&self) -> usize
pub fn recv_buf_size(&self) -> usize
Get the receive buffer size, using default if not configured.
Sourcepub fn send_buf_size(&self) -> usize
pub fn send_buf_size(&self) -> usize
Get the send buffer size, using default if not configured.
Sourcepub fn auto_connect(&self) -> bool
pub fn auto_connect(&self) -> bool
Whether to auto-connect to discovered peers. Default: false.
Sourcepub fn accept_connections(&self) -> bool
pub fn accept_connections(&self) -> bool
Whether to accept incoming connections. Default: false.
Sourcepub fn beacon_interval_secs(&self) -> u64
pub fn beacon_interval_secs(&self) -> u64
Get the beacon interval, clamped to minimum. Default: 30s.
Trait Implementations§
Source§impl Clone for EthernetConfig
impl Clone for EthernetConfig
Source§fn clone(&self) -> EthernetConfig
fn clone(&self) -> EthernetConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EthernetConfig
impl Debug for EthernetConfig
Source§impl Default for EthernetConfig
impl Default for EthernetConfig
Source§fn default() -> EthernetConfig
fn default() -> EthernetConfig
Source§impl<'de> Deserialize<'de> for EthernetConfig
impl<'de> Deserialize<'de> for EthernetConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for EthernetConfig
impl RefUnwindSafe for EthernetConfig
impl Send for EthernetConfig
impl Sync for EthernetConfig
impl Unpin for EthernetConfig
impl UnsafeUnpin for EthernetConfig
impl UnwindSafe for EthernetConfig
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> 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 more