pub fn message_type(&self) -> Result<MessageType, CaptivePortalError> {
        if let Some(x) = self.option(DHCP_MESSAGE_TYPE) {
            if x.len() != 1 {
                Err(CaptivePortalError::DhcpError("Invalid length for DHCP MessageType"))
            } else {
                MessageType::from(x[0])
            }
        } else {
            Err(CaptivePortalError::DhcpError("Packet does not have MessageType option"))
        }
    }
/// Convenience function for extracting packet's message type.
Convenience function for extracting packet's message type.
Convenience function for extracting packet ' s message type .
pub fn message_type(&self) -> Result<MessageType, CaptivePortalError> {
        if let Some(x) = self.option(DHCP_MESSAGE_TYPE) {
            if x.len() != 1 {
                Err(CaptivePortalError::DhcpError("Invalid length for DHCP MessageType"))
            } else {
                MessageType::from(x[0])
            }
        } else {
            Err(CaptivePortalError::DhcpError("Packet does not have MessageType option"))
        }
    }
pub fn message_type ( & self ) -> Result < MessageType , CaptivePortalError > { if let Some ( x ) = self . option ( DHCP_MESSAGE_TYPE ) { if x . len ( ) != 1 { Err ( CaptivePortalError :: DhcpError ( " " ) ) } else { MessageType :: from ( x [ 0 ] ) } } else { Err ( CaptivePortalError :: DhcpError ( " " ) ) } }
Convenience function for extracting packet's message type.
Convenience function for extracting packet ' s message type .
&self
&self