#[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<'de> Deserialize<'de> for ReplyCode
impl<'de> Deserialize<'de> for ReplyCode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReplyCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReplyCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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 Error for ReplyCode
impl Error for ReplyCode
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ErrorReplyReason> for ReplyCode
impl From<ErrorReplyReason> for ReplyCode
Source§fn from(source: ErrorReplyReason) -> ReplyCode
fn from(source: ErrorReplyReason) -> ReplyCode
Converts to this type from the input type.
Source§impl From<SuccessReplyReason> for ReplyCode
impl From<SuccessReplyReason> for ReplyCode
Source§fn from(source: SuccessReplyReason) -> ReplyCode
fn from(source: SuccessReplyReason) -> ReplyCode
Converts to this type from the input type.
Source§impl Sequence for ReplyCode
impl Sequence for ReplyCode
Source§impl Serialize for ReplyCode
impl Serialize for ReplyCode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
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.