#[non_exhaustive]pub enum NetStackError {
Show 13 variants
#[non_exhaustive] PrefixInvalid {
network: IpAddr,
prefix_len: u8,
reason: &'static str,
},
#[non_exhaustive] MtuInvalid {
mtu: u16,
minimum: u16,
},
#[non_exhaustive] InterfaceNameInvalid {
name: String,
},
NoProtocols,
SharedNamespace,
#[non_exhaustive] NamespaceJoin {
which: &'static str,
source: Option<Error>,
},
#[non_exhaustive] TapOpen {
source: Error,
},
#[non_exhaustive] TapCreate {
name: String,
source: Error,
},
#[non_exhaustive] TapConfigure {
detail: &'static str,
source: Error,
},
#[non_exhaustive] TapHandoff {
source: Error,
},
#[non_exhaustive] Spawn {
source: Error,
},
HelperLost,
#[non_exhaustive] Pump {
op: &'static str,
source: Option<Error>,
},
}Expand description
An error from building or running a network stack.
Never a crate::Error: the stack is an attachment to a sandbox, not
part of launching one, and its failures are its own. A failed
attach leaves the pending launch untouched — the
caller may still proceed (without connectivity) or drop it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]PrefixInvalid
A configured network cannot hold the stack’s address plan.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]MtuInvalid
The MTU is below the minimum for the enabled protocols.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]InterfaceNameInvalid
The interface name does not satisfy the kernel’s rules.
Fields
This variant is marked as non-exhaustive
NoProtocols
The configuration enables neither IPv4 nor IPv6.
The sandbox shares the caller’s network namespace, where a stack
must not attach. Sandboxes built with
Network::Host are refused with this error.
#[non_exhaustive]NamespaceJoin
The sandbox’s network namespace could not be examined or joined.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]TapOpen
/dev/net/tun could not be opened.
The tun device is compiled into every mainstream kernel but a host may omit the module or restrict the device node; the stack cannot run there.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]TapCreate
The tap interface could not be created.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]TapConfigure
The tap interface was created but could not be configured.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]TapHandoff
The tap was created and configured, but its descriptor could not be handed back to the caller.
Distinct from TapConfigure: nothing is
wrong with the interface, only with the handoff, and the tap is
destroyed with the helper that made it.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Spawn
The stack’s helper process or pump thread could not be started.
Fields
This variant is marked as non-exhaustive
HelperLost
The tap helper exited without delivering a result.
The helper always reports an outcome — the tap descriptor or a typed failure — before it exits; silence means it was killed from outside or its result could not be read.
#[non_exhaustive]Pump
The pump stopped on an error of its own machinery, reported by
NetStackHandle::stop.
Fields
This variant is marked as non-exhaustive
Trait Implementations§
Source§impl Debug for NetStackError
impl Debug for NetStackError
Source§impl Display for NetStackError
impl Display for NetStackError
Source§impl Error for NetStackError
impl Error for NetStackError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The OS failure underneath, where there is one.
The configuration refusals — an unusable prefix, an MTU below the
minimum, an invalid interface name, no protocols, a shared namespace —
carry no inner error: nothing failed, the request was refused.
HelperLost carries none either: the helper’s
silence is the failure.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for NetStackError
impl !UnwindSafe for NetStackError
impl Freeze for NetStackError
impl Send for NetStackError
impl Sync for NetStackError
impl Unpin for NetStackError
impl UnsafeUnpin for NetStackError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.