#[non_exhaustive]pub enum HandleError {
Parse(ParseError),
InvalidOpcode(Opcode),
InvalidResponseCode(ResponseCode),
}Expand description
Errors raised by Endpoint::handle.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse(ParseError)
The datagram could not be parsed.
InvalidOpcode(Opcode)
The incoming opcode is not Query (mDNS only supports Query).
InvalidResponseCode(ResponseCode)
The incoming response code is not NoError (mDNS requires NoError).
Implementations§
Source§impl HandleError
impl HandleError
Sourcepub const fn is_parse(&self) -> bool
pub const fn is_parse(&self) -> bool
Returns true if this value is of type Parse. Returns false otherwise
Sourcepub const fn is_invalid_opcode(&self) -> bool
pub const fn is_invalid_opcode(&self) -> bool
Returns true if this value is of type InvalidOpcode. Returns false otherwise
Sourcepub const fn is_invalid_response_code(&self) -> bool
pub const fn is_invalid_response_code(&self) -> bool
Returns true if this value is of type InvalidResponseCode. Returns false otherwise
Source§impl HandleError
impl HandleError
Sourcepub fn unwrap_parse(self) -> ParseError
pub fn unwrap_parse(self) -> ParseError
Unwraps this value to the HandleError::Parse variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_parse_ref(&self) -> &ParseError
pub fn unwrap_parse_ref(&self) -> &ParseError
Unwraps this reference to the HandleError::Parse variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_opcode(self) -> Opcode
pub fn unwrap_invalid_opcode(self) -> Opcode
Unwraps this value to the HandleError::InvalidOpcode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_opcode_ref(&self) -> &Opcode
pub fn unwrap_invalid_opcode_ref(&self) -> &Opcode
Unwraps this reference to the HandleError::InvalidOpcode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_response_code(self) -> ResponseCode
pub fn unwrap_invalid_response_code(self) -> ResponseCode
Unwraps this value to the HandleError::InvalidResponseCode variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_response_code_ref(&self) -> &ResponseCode
pub fn unwrap_invalid_response_code_ref(&self) -> &ResponseCode
Unwraps this reference to the HandleError::InvalidResponseCode variant.
Panics if this value is of any other type.
Source§impl HandleError
impl HandleError
Sourcepub fn try_unwrap_parse(self) -> Result<ParseError, TryUnwrapError<Self>>
pub fn try_unwrap_parse(self) -> Result<ParseError, TryUnwrapError<Self>>
Attempts to unwrap this value to the HandleError::Parse variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_parse_ref(&self) -> Result<&ParseError, TryUnwrapError<&Self>>
pub fn try_unwrap_parse_ref(&self) -> Result<&ParseError, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the HandleError::Parse variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_opcode(self) -> Result<Opcode, TryUnwrapError<Self>>
pub fn try_unwrap_invalid_opcode(self) -> Result<Opcode, TryUnwrapError<Self>>
Attempts to unwrap this value to the HandleError::InvalidOpcode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_opcode_ref(
&self,
) -> Result<&Opcode, TryUnwrapError<&Self>>
pub fn try_unwrap_invalid_opcode_ref( &self, ) -> Result<&Opcode, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the HandleError::InvalidOpcode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_response_code(
self,
) -> Result<ResponseCode, TryUnwrapError<Self>>
pub fn try_unwrap_invalid_response_code( self, ) -> Result<ResponseCode, TryUnwrapError<Self>>
Attempts to unwrap this value to the HandleError::InvalidResponseCode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_response_code_ref(
&self,
) -> Result<&ResponseCode, TryUnwrapError<&Self>>
pub fn try_unwrap_invalid_response_code_ref( &self, ) -> Result<&ResponseCode, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the HandleError::InvalidResponseCode variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl Clone for HandleError
impl Clone for HandleError
Source§fn clone(&self) -> HandleError
fn clone(&self) -> HandleError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HandleError
impl Debug for HandleError
Source§impl Display for HandleError
impl Display for HandleError
Source§impl Error for HandleError
impl Error for HandleError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()