pub enum NetTransportError<A: AddressResolver> {
NoPrivateIP,
EmptyBindAddresses,
BlockedIp(IpAddr),
ListenPacket(SocketAddr, Error),
ListenPromised(SocketAddr, Error),
Resolver(A::Error),
Resolve {
addr: A::Address,
err: A::Error,
},
PacketTooLarge(usize),
Io(Error),
Custom(Cow<'static, str>),
}
Expand description
Errors that can occur when using NetTransport
.
Variants§
NoPrivateIP
Returns when there is no explicit advertise address and no private IP address found.
EmptyBindAddresses
Returns when there is no bind address provided.
BlockedIp(IpAddr)
Returns when the ip is blocked.
ListenPacket(SocketAddr, Error)
Returns when the packet socket fails to bind.
ListenPromised(SocketAddr, Error)
Returns when the promised listener fails to bind.
Resolver(A::Error)
Returns when the failed to create a resolver for the transport.
Resolve
Returns when we fail to resolve an address.
PacketTooLarge(usize)
Returns when the packet is too large.
Io(Error)
Returns when there is an I/O error.
Custom(Cow<'static, str>)
Returns when there is a custom error.
Trait Implementations§
Source§impl<A: AddressResolver> Debug for NetTransportError<A>
impl<A: AddressResolver> Debug for NetTransportError<A>
Source§impl<A: AddressResolver> Display for NetTransportError<A>
impl<A: AddressResolver> Display for NetTransportError<A>
Source§impl<A: AddressResolver> Error for NetTransportError<A>
impl<A: AddressResolver> Error for NetTransportError<A>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<A: AddressResolver> From<Error> for NetTransportError<A>
impl<A: AddressResolver> From<Error> for NetTransportError<A>
Source§impl<A> TransportError for NetTransportError<A>
impl<A> TransportError for NetTransportError<A>
Auto Trait Implementations§
impl<A> Freeze for NetTransportError<A>
impl<A> !RefUnwindSafe for NetTransportError<A>
impl<A> Send for NetTransportError<A>
impl<A> Sync for NetTransportError<A>
impl<A> Unpin for NetTransportError<A>
impl<A> !UnwindSafe for NetTransportError<A>
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> 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