#[repr(u8)]pub enum ReplyCode {
    Success(SuccessReplyReason),
    Error(ErrorReplyReason),
    Unsupported = 255,
}Expand description
Enum representing reply code with reason of its creation.
Variants§
Success(SuccessReplyReason)
Success reply.
Error(ErrorReplyReason)
Error reply.
Unsupported = 255
Unsupported code. Variant exists for backward compatibility.
Implementations§
source§impl ReplyCode
 
impl ReplyCode
sourcepub fn from_bytes(bytes: [u8; 4]) -> ReplyCode
 
pub fn from_bytes(bytes: [u8; 4]) -> ReplyCode
Parses 4 bytes array to ReplyCode.
sourcepub fn error(reason: impl Into<ErrorReplyReason>) -> ReplyCode
 
pub fn error(reason: impl Into<ErrorReplyReason>) -> ReplyCode
Constructs ReplyCode::Error(_) variant from underlying reason.
sourcepub fn is_success(&self) -> bool
 
pub fn is_success(&self) -> bool
Returns bool, defining if ReplyCode represents success reply.
sourcepub fn is_unsupported(&self) -> bool
 
pub fn is_unsupported(&self) -> bool
Returns bool, defining if ReplyCode represents unsupported reason.
Trait Implementations§
source§impl Decode for ReplyCode
 
impl Decode for ReplyCode
source§fn decode<__CodecInputEdqy>(
    __codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<ReplyCode, Error>where
    __CodecInputEdqy: Input,
 
fn decode<__CodecInputEdqy>(
    __codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<ReplyCode, Error>where
    __CodecInputEdqy: Input,
Attempt to deserialise the value from input.
source§fn decode_into<I>(
    input: &mut I,
    dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
    I: Input,
 
fn decode_into<I>(
    input: &mut I,
    dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
    I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§impl Encode for ReplyCode
 
impl Encode for ReplyCode
source§fn size_hint(&self) -> usize
 
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy>(
    &self,
    __codec_dest_edqy: &mut __CodecOutputEdqy,
)
 
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
source§fn using_encoded<R, F>(&self, f: F) -> R
 
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
 
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl From<ErrorReplyReason> for ReplyCode
 
impl From<ErrorReplyReason> for ReplyCode
source§fn from(original: ErrorReplyReason) -> ReplyCode
 
fn from(original: ErrorReplyReason) -> ReplyCode
Converts to this type from the input type.
source§impl From<SuccessReplyReason> for ReplyCode
 
impl From<SuccessReplyReason> for ReplyCode
source§fn from(original: SuccessReplyReason) -> ReplyCode
 
fn from(original: SuccessReplyReason) -> ReplyCode
Converts to this type from the input type.
source§impl Ord for ReplyCode
 
impl Ord for ReplyCode
source§impl PartialOrd for ReplyCode
 
impl PartialOrd for ReplyCode
source§impl Sequence for ReplyCode
 
impl Sequence for ReplyCode
impl Copy for ReplyCode
impl EncodeLike for ReplyCode
impl Eq for ReplyCode
impl StructuralPartialEq for ReplyCode
Auto Trait Implementations§
impl Freeze for ReplyCode
impl RefUnwindSafe for ReplyCode
impl Send for ReplyCode
impl Sync for ReplyCode
impl Unpin for ReplyCode
impl UnwindSafe for ReplyCode
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)