Enum ProtocolErrorCode

Source
#[repr(u64)]
pub enum ProtocolErrorCode {
Show 20 variants Ok = 0, IndexOutOfBound = 1, ItemMissing = 2, LengthNotEnough = 3, InvalidData = 4, WaitFailure = 5, InvalidFd = 6, OtherEndClosed = 7, MaxVmsSpawned = 8, MaxFdsCreated = 9, UnknownError = 20, UnknownSysError = 21, UnexpectedEof = 22, IncompleteVlqSeq = 23, DecodeVlqOverflow = 24, ReadVlqError = 25, SerializeError = 26, DeserializeError = 27, GeneralIoError = 28, EndOfError = 29,
}
Expand description

Protocol error code used in wire protocol. Its range from 1 to 2^64 - 1. 1~20 are with same values used in syscall error.

Variants§

§

Ok = 0

§

IndexOutOfBound = 1

Index out of bound

§

ItemMissing = 2

Field is missing for the target

§

LengthNotEnough = 3

Buffer length is not enough, error contains actual data length

§

InvalidData = 4

Data encoding error(molecule)

§

WaitFailure = 5

Failed to wait.

§

InvalidFd = 6

Invalid file descriptor.

§

OtherEndClosed = 7

Reading from or writing to file descriptor failed due to other end closed.

§

MaxVmsSpawned = 8

Max vms has been spawned.

§

MaxFdsCreated = 9

Max fds has been spawned.

§

UnknownError = 20

Unknown error code

§

UnknownSysError = 21

Unknown error from SysError in ckb-std

§

UnexpectedEof = 22

Unexpected EOF

§

IncompleteVlqSeq = 23

VQL error: incomplete VLQ sequence

§

DecodeVlqOverflow = 24

VLQ error: decoding overflow

§

ReadVlqError = 25

VLQ error: reading error

§

SerializeError = 26

Serialize error

§

DeserializeError = 27

Deserialize error

§

GeneralIoError = 28

general IO error

§

EndOfError = 29

Implementations§

Source§

impl ProtocolErrorCode

Source

pub fn n(value: u64) -> Option<Self>

Trait Implementations§

Source§

impl Clone for ProtocolErrorCode

Source§

fn clone(&self) -> ProtocolErrorCode

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProtocolErrorCode

Source§

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

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

impl From<IpcError> for ProtocolErrorCode

Source§

fn from(err: IpcError) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for ProtocolErrorCode

Source§

fn from(e: u64) -> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.