use core::fmt;
pub enum Error {
InterceptorBadSignature,
InterceptorAlreadyReplaced,
PolicyViolation,
InterceptorError,
MemoryAccessError,
WrongType,
}
impl fmt::Display for Error {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::InterceptorBadSignature => write!(fmt, "Bad signature"),
Error::InterceptorAlreadyReplaced => write!(fmt, "Function already replaced"),
Error::PolicyViolation => write!(fmt, "Policy violation"),
Error::InterceptorError => write!(fmt, "Interceptor error"),
Error::MemoryAccessError => write!(fmt, "Memory access error"),
Error::WrongType => write!(fmt, "Wrong type"),
}
}
}
impl fmt::Debug for Error {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(fmt, "{self:}")
}
}
#[allow(unused)]
pub type GumResult<T> = Result<T, Error>;