use nom::error::{ErrorKind, ParseError};
#[derive(Debug, PartialEq)]
pub enum RdpError {
UnimplementedLengthDeterminant,
NotX224Class0Error,
NomError(ErrorKind),
}
impl<I> ParseError<I> for RdpError {
fn from_error_kind(_input: I, kind: ErrorKind) -> Self {
RdpError::NomError(kind)
}
fn append(_input: I, kind: ErrorKind, _other: Self) -> Self {
RdpError::NomError(kind)
}
}
impl nom::ErrorConvert<RdpError> for ((&[u8], usize), ErrorKind) {
fn convert(self) -> RdpError {
RdpError::NomError(self.1)
}
}