basic get / set / delete / has

This commit is contained in:
2025-06-12 15:52:01 +02:00
commit 7a6b1b6954
11 changed files with 916 additions and 0 deletions

21
src/errors.rs Normal file
View File

@@ -0,0 +1,21 @@
use thiserror::Error;
#[derive(Debug, Error)]
pub enum AppError {
#[error("An IO error occurred")]
Io(#[from] std::io::Error),
#[error("A TryGetError occurred")]
TryGet(#[from] bytes::TryGetError),
#[error("The buffer is missing data for a complete command")]
IncompleteCommandBuffer,
#[error("A Utf8Error occurred")]
FromUtf8(#[from] std::string::FromUtf8Error),
#[error("The command {0} was not recognized")]
UnknownCommand(String),
#[error("The specified key's length {0} exceeds the limit")]
KeyLength(usize),
#[error("Received no response")]
NoResponse,
#[error("Expected a different response for the executed command")]
InvalidCommandResponse,
}