Enum libnatpmp::Error

source ·
pub enum Error {
Show 19 variants NATPMP_ERR_INVALIDARGS, NATPMP_ERR_SOCKETERROR, NATPMP_ERR_CANNOTGETGATEWAY, NATPMP_ERR_CLOSEERR, NATPMP_ERR_RECVFROM, NATPMP_ERR_NOPENDINGREQ, NATPMP_ERR_NOGATEWAYSUPPORT, NATPMP_ERR_CONNECTERR, NATPMP_ERR_WRONGPACKETSOURCE, NATPMP_ERR_SENDERR, NATPMP_ERR_FCNTLERROR, NATPMP_ERR_GETTIMEOFDAYERR, NATPMP_ERR_UNSUPPORTEDVERSION, NATPMP_ERR_UNSUPPORTEDOPCODE, NATPMP_ERR_UNDEFINEDERROR, NATPMP_ERR_NOTAUTHORIZED, NATPMP_ERR_NETWORKFAILURE, NATPMP_ERR_OUTOFRESOURCES, NATPMP_TRYAGAIN,
}
Expand description

NAT-PMP error.

Note

These errors are for compatibility only:

Examples

use natpmp::*;

let err = Error::NATPMP_ERR_CANNOTGETGATEWAY;
println!("{}", err);

Variants

NATPMP_ERR_INVALIDARGS

Invalid arguments

NATPMP_ERR_SOCKETERROR

Failed to create a socket

NATPMP_ERR_CANNOTGETGATEWAY

Can not get default gateway address

NATPMP_ERR_CLOSEERR

Failed to close socket

NATPMP_ERR_RECVFROM

Failed to recvfrom socket

NATPMP_ERR_NOPENDINGREQ

No pending request

NATPMP_ERR_NOGATEWAYSUPPORT

Gateway does not support NAT-PMP

NATPMP_ERR_CONNECTERR

Failed to connect to the gateway

NATPMP_ERR_WRONGPACKETSOURCE

Packet not received from the gateway

NATPMP_ERR_SENDERR

Failed to send

NATPMP_ERR_FCNTLERROR

Failed to set nonblocking

NATPMP_ERR_GETTIMEOFDAYERR

Failed to get time

NATPMP_ERR_UNSUPPORTEDVERSION

Unsupported NAT-PMP version

NATPMP_ERR_UNSUPPORTEDOPCODE

Unsupported NAT-PMP opcode

NATPMP_ERR_UNDEFINEDERROR

Unknown NAT-PMP error

NATPMP_ERR_NOTAUTHORIZED

Not authorized

NATPMP_ERR_NETWORKFAILURE

Network failure

NATPMP_ERR_OUTOFRESOURCES

NAT-PMP out of resources

NATPMP_TRYAGAIN

Try again

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.