#[repr(u16)]
pub enum StatusCode {
OK,
MalformedProtocolMessage,
UnexpectedProtocolMessage,
InvalidRequest,
InvalidLastBlock,
InvalidUnconfirmedBlock,
InvaildDifficultyBoundary,
InternalError,
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 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
OK
MalformedProtocolMessage
Malformed protocol message.
UnexpectedProtocolMessage
Unexpected light-client protocol message.
InvalidRequest
The request data is incorrect.
InvalidLastBlock
The last block sent from client is invalid.
InvalidUnconfirmedBlock
At least one unconfirmed block sent from client is invalid.
InvaildDifficultyBoundary
The difficulty boundary is not in the provided block range.
InternalError
Throws an internal error.
Network
Throws an error from the network.
Implementations
sourceimpl 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
sourceimpl Clone for StatusCode
impl Clone for StatusCode
sourcefn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for StatusCode
impl Debug for StatusCode
sourceimpl From<StatusCode> for Status
impl From<StatusCode> for Status
sourcefn from(code: StatusCode) -> Self
fn from(code: StatusCode) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
sourcefn eq(&self, other: &StatusCode) -> bool
fn eq(&self, other: &StatusCode) -> bool
impl Copy for StatusCode
impl Eq for StatusCode
impl StructuralEq for StatusCode
impl StructuralPartialEq for StatusCode
Auto Trait Implementations
impl RefUnwindSafe for StatusCode
impl Send for StatusCode
impl Sync for StatusCode
impl Unpin for StatusCode
impl UnwindSafe for StatusCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.