Skip to main content

NetError

Enum NetError 

Source
#[repr(C)]
pub enum NetError {
Show 13 variants Success = 0, NullPointer = -1, InvalidUtf8 = -2, InvalidJson = -3, InitFailed = -4, IngestionFailed = -5, PollFailed = -6, BufferTooSmall = -7, ShuttingDown = -8, IntOverflow = -9, MismatchedHandles = -10, InteriorNul = -11, Unknown = -99,
}
Expand description

Error codes returned by FFI functions.

Variants§

§

Success = 0

Success (no error).

§

NullPointer = -1

Null pointer passed.

§

InvalidUtf8 = -2

Invalid UTF-8 string.

§

InvalidJson = -3

Invalid JSON.

§

InitFailed = -4

Initialization failed.

§

IngestionFailed = -5

Ingestion failed (backpressure).

§

PollFailed = -6

Poll failed.

§

BufferTooSmall = -7

Buffer too small.

§

ShuttingDown = -8

Shutting down.

§

IntOverflow = -9

Integer overflow: result does not fit in c_int.

§

MismatchedHandles = -10

Stream handle does not belong to the supplied node handle. Previously the send-family FFIs accepted any (stream, node) pair without verifying they were created from the same node, allowing silent cross-session traffic.

§

InteriorNul = -11

CString::new failure: the input bytes are valid UTF-8 by Rust’s String invariant but contain an interior NUL byte — and the C ABI cannot represent that, since C strings are NUL-terminated. Pre-fix this was reported as InvalidUtf8, which was wrong: the input is UTF-8-valid; it just has a NUL where C expects it not to. A binding reading the typed error and seeing “invalid UTF-8” would chase the wrong cause.

§

Unknown = -99

Unknown error.

Trait Implementations§

Source§

impl From<NetError> for c_int

Source§

fn from(e: NetError) -> Self

Converts to this type from the input type.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more