1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use std::{error::Error, fmt}; #[derive(Debug)] pub enum RedisError { ParseError, SocketConnectionError, } impl Error for RedisError {} impl fmt::Display for RedisError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "An error occured") } } #[derive(Debug, PartialEq)] /// The type the response data will be according to RESP specification pub enum ResponseType { SimpleString, Error, Integer, BulkString, Array, Base, }