RLanLibError

Enum RLanLibError 

Source
pub enum RLanLibError {
    Wire(String),
    NotifierSendError(SendError<Box<ScanMessage>>),
    PacketReaderLock(String),
    PacketSenderLock(String),
    ThreadError(String),
    ChannelReceive(RecvError),
    ArpPacketBuild(ArpPacketBuilderError),
    RstPacketBuild(RstPacketBuilderError),
    SynPacketBuild(SynPacketBuilderError),
    HeartbeatPacketBuild(HeartbeatPacketBuilderError),
    Scan {
        error: String,
        ip: Option<String>,
        port: Option<String>,
    },
}
Expand description

Custom Error type for this library

Variants§

§

Wire(String)

Error coming directly off the wire

§

NotifierSendError(SendError<Box<ScanMessage>>)

Errors resulting from events channel

§

PacketReaderLock(String)

Error obtaining lock on packet reader

§

PacketSenderLock(String)

Error obtaining lock on packet sender

§

ThreadError(String)

Generic thread error

§

ChannelReceive(RecvError)

Errors when consuming messages from channels

§

ArpPacketBuild(ArpPacketBuilderError)

Error generated during ARP packet construction

§

RstPacketBuild(RstPacketBuilderError)

Error generated during RST packet construction

§

SynPacketBuild(SynPacketBuilderError)

Error generated during SYN packet construction

§

HeartbeatPacketBuild(HeartbeatPacketBuilderError)

Error generated during heartbeat packet construction

§

Scan

Wrapping errors related to scanning

Fields

§error: String

The error message encountered

§ip: Option<String>

The associated IP address being scanned

§port: Option<String>

The associated port being scanned

Implementations§

Source§

impl RLanLibError

Source

pub fn from_net_addr_parse_error(ip: &str, error: AddrParseError) -> Self

Converter for std::net::AddrParseError

Source

pub fn from_ipnet_addr_parse_error(ip: &str, error: AddrParseError) -> Self

Converter for ipnet::AddrParseError

Source

pub fn from_port_parse_int_err(port: &str, error: ParseIntError) -> Self

Converter for ParseIntError

Source

pub fn from_channel_send_error(e: SendError<ScanMessage>) -> Self

Converter for channel send errors

Trait Implementations§

Source§

impl Debug for RLanLibError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RLanLibError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RLanLibError

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ArpPacketBuilderError> for RLanLibError

Source§

fn from(source: ArpPacketBuilderError) -> Self

Converts to this type from the input type.
Source§

impl From<Box<dyn Any + Send>> for RLanLibError

Source§

fn from(value: Box<dyn Any + Send>) -> Self

Converts to this type from the input type.
Source§

impl From<HeartbeatPacketBuilderError> for RLanLibError

Source§

fn from(source: HeartbeatPacketBuilderError) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PoisonError<MutexGuard<'a, dyn Reader + 'static>>> for RLanLibError

Source§

fn from(value: PoisonError<MutexGuard<'a, dyn Reader + 'static>>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PoisonError<MutexGuard<'a, dyn Sender + 'static>>> for RLanLibError

Source§

fn from(value: PoisonError<MutexGuard<'a, dyn Sender + 'static>>) -> Self

Converts to this type from the input type.
Source§

impl From<RecvError> for RLanLibError

Source§

fn from(source: RecvError) -> Self

Converts to this type from the input type.
Source§

impl From<RstPacketBuilderError> for RLanLibError

Source§

fn from(source: RstPacketBuilderError) -> Self

Converts to this type from the input type.
Source§

impl From<SendError<Box<ScanMessage>>> for RLanLibError

Source§

fn from(source: SendError<Box<ScanMessage>>) -> Self

Converts to this type from the input type.
Source§

impl From<SynPacketBuilderError> for RLanLibError

Source§

fn from(source: SynPacketBuilderError) -> Self

Converts to this type from the input type.
Source§

impl Send for RLanLibError

Source§

impl Sync for RLanLibError

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, 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.