pub struct NetConfig {
pub mac: [u8; 6],
pub mtu: u16,
pub tap_name: Option<String>,
pub num_queues: u16,
}Expand description
Network device configuration.
Fields§
§mac: [u8; 6]MAC address.
mtu: u16MTU size.
tap_name: Option<String>TAP device name (if applicable).
num_queues: u16Number of queue pairs.
Implementations§
Source§impl NetConfig
impl NetConfig
Sourcepub fn random_mac() -> [u8; 6]
pub fn random_mac() -> [u8; 6]
Generates a random MAC address.
The first three bytes are the locally-administered ArcBox OUI
(52:54:AB). The remaining three bytes come from getrandom, giving
24 bits of true entropy — 1-in-16M collision odds. Time-derived
fallbacks were rejected because concurrent VM creation within the
same nanosecond tick would otherwise produce identical MACs and
poison the host ARP cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NetConfig
impl RefUnwindSafe for NetConfig
impl Send for NetConfig
impl Sync for NetConfig
impl Unpin for NetConfig
impl UnsafeUnpin for NetConfig
impl UnwindSafe for NetConfig
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
Mutably borrows from an owned value. Read more
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>
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 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>
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