#[repr(u16)]pub enum StatusCode {
OK = 200,
MalformedProtocolMessage = 400,
UnexpectedProtocolMessage = 401,
InvalidRequest = 410,
InvalidLastBlock = 411,
InvalidUnconfirmedBlock = 412,
InvaildDifficultyBoundary = 413,
InternalError = 500,
Network = 501,
}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 response – the request was received, continuing process.
- 2xx: Success - The action requested by the client was received, understood, and accepted.
- 4xx: Client errors - The error seems to have been caused by the client.
- 5xx: Server errors - The server failed to fulfil a request.
Variants§
OK = 200
OK
MalformedProtocolMessage = 400
Malformed protocol message.
UnexpectedProtocolMessage = 401
Unexpected light-client protocol message.
InvalidRequest = 410
The request data is incorrect.
InvalidLastBlock = 411
The last block sent from client is invalid.
InvalidUnconfirmedBlock = 412
At least one unconfirmed block sent from client is invalid.
InvaildDifficultyBoundary = 413
The difficulty boundary is not in the provided block range.
InternalError = 500
Throws an internal error.
Network = 501
Throws an error from the network.
Implementations§
Source§impl StatusCode
impl StatusCode
Sourcepub fn with_context<S: ToString>(self, context: S) -> Status
pub fn with_context<S: ToString>(self, context: S) -> Status
Convert a status code into a status which has a context.
Trait Implementations§
Source§impl Clone for StatusCode
impl Clone for StatusCode
Source§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StatusCode
impl Debug for StatusCode
Source§impl From<StatusCode> for Status
impl From<StatusCode> for Status
Source§fn from(code: StatusCode) -> Self
fn from(code: StatusCode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
impl Copy for StatusCode
impl Eq for StatusCode
impl StructuralPartialEq for StatusCode
Auto Trait Implementations§
impl Freeze for StatusCode
impl RefUnwindSafe for StatusCode
impl Send for StatusCode
impl Sync for StatusCode
impl Unpin for StatusCode
impl UnwindSafe for StatusCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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