Enum ckb_sync::StatusCode

source ·
#[repr(u16)]
pub enum StatusCode {
Show 32 variants OK, Ignored, CompactBlockIsAlreadyPending, CompactBlockIsAlreadyInFlight, CompactBlockAlreadyStored, CompactBlockIsStaled, CompactBlockRequiresParent, CompactBlockRequiresFreshTransactions, CompactBlockMeetsShortIdsCollision, BlocksInFlightReachLimit, TooManyRequests, ProtocolMessageIsMalformed, BlockIsInvalid, CompactBlockHasInvalidHeader, CompactBlockHasDuplicatedShortIds, CompactBlockHasNotPrefilledCellbase, CompactBlockHasDuplicatedPrefilledTransactions, CompactBlockHasOutOfOrderPrefilledTransactions, CompactBlockHasOutOfIndexPrefilledTransactions, CompactBlockHasInvalidUncle, CompactBlockHasUnmatchedTransactionRootWithReconstructedBlock, BlockTransactionsLengthIsUnmatchedWithPendingCompactBlock, BlockTransactionsShortIdsAreUnmatchedWithPendingCompactBlock, BlockUnclesLengthIsUnmatchedWithPendingCompactBlock, BlockUnclesAreUnmatchedWithPendingCompactBlock, GetHeadersMissCommonAncestors, HeadersIsInvalid, TooManyUnknownTransactions, RequestGenesis, RequestDuplicate, TxPool, Network,
}
Expand description

StatusCodes indicate whether a specific operation has been successfully completed. The StatusCode element is a 3-digit integer.

The first digest of the StatusCode defines the class of result:

  • 1xx: Informational - Request received, continuing process
  • 4xx: Malformed Error - The request contains malformed messages
  • 5xx: Warning - The node warns about recoverable conditions

Variants§

§

OK

OK

§

Ignored

Ignored

§

CompactBlockIsAlreadyPending

The node had already received and recorded this block as pending block

§

CompactBlockIsAlreadyInFlight

The node is requesting from other peers for this block, but no response yet

§

CompactBlockAlreadyStored

The node had already stored this block into database

§

CompactBlockIsStaled

The CompactBlock is older than what the node expects

§

CompactBlockRequiresParent

The node cannot process the arrived CompactBlock successfully for lack of information of its parent

§

CompactBlockRequiresFreshTransactions

The node cannot process the arrived CompactBlock successfully for lack of parts of its transactions

§

CompactBlockMeetsShortIdsCollision

CompactBlock short-ids collision

§

BlocksInFlightReachLimit

In-flight blocks limit exceeded

§

TooManyRequests

Generic rate limit error

§

ProtocolMessageIsMalformed

Malformed protocol message

§

BlockIsInvalid

Block verified failed or the block is already marked as invalid

§

CompactBlockHasInvalidHeader

Header verified failed or the header is already marked as invalid

§

CompactBlockHasDuplicatedShortIds

Duplicated short-ids within a same CompactBlock

§

CompactBlockHasNotPrefilledCellbase

Missing cellbase as the first transaction within a CompactBlock

§

CompactBlockHasDuplicatedPrefilledTransactions

Duplicated prefilled transactions within a same CompactBlock

§

CompactBlockHasOutOfOrderPrefilledTransactions

The prefilled transactions are out-of-order

§

CompactBlockHasOutOfIndexPrefilledTransactions

Some of the prefilled transactions are out-of-index

§

CompactBlockHasInvalidUncle

Invalid uncle block

§

CompactBlockHasUnmatchedTransactionRootWithReconstructedBlock

Unmatched Transaction Root

§

BlockTransactionsLengthIsUnmatchedWithPendingCompactBlock

The length of BlockTransactions is unmatched with in pending_compact_blocks

§

BlockTransactionsShortIdsAreUnmatchedWithPendingCompactBlock

The short-ids of BlockTransactions is unmatched with in pending_compact_blocks

§

BlockUnclesLengthIsUnmatchedWithPendingCompactBlock

The length of BlockUncles is unmatched with in pending_compact_blocks

§

BlockUnclesAreUnmatchedWithPendingCompactBlock

The hash of uncles is unmatched

§

GetHeadersMissCommonAncestors

Cannot locate the common blocks based on the GetHeaders

§

HeadersIsInvalid

Headers verified failed

§

TooManyUnknownTransactions

Too many unknown transactions

§

RequestGenesis

Request Genesis

§

RequestDuplicate

Request Duplicate data

§

TxPool

Errors returned from the tx-pool

§

Network

Errors returned from the network layer

Implementations§

source§

impl StatusCode

source

pub fn with_context<S: ToString>(self, context: S) -> Status

Code with context

source

pub fn name(self) -> String

StatusCode’s name like Ok(100)

Trait Implementations§

source§

impl Clone for StatusCode

source§

fn clone(&self) -> StatusCode

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 StatusCode

source§

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

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

impl From<StatusCode> for Status

source§

fn from(code: StatusCode) -> Self

Converts to this type from the input type.
source§

impl PartialEq<StatusCode> for StatusCode

source§

fn eq(&self, other: &StatusCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for StatusCode

source§

impl Eq for StatusCode

source§

impl StructuralEq for StatusCode

source§

impl StructuralPartialEq for StatusCode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for Twhere T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

Cast to trait Any
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

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