ChessPenguin 0.1.0
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run

Native chess database for Linux: PGN library, notation with variations and
comments, UCI engine analysis, move entry and export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubel 2026-10-18 01:54:06 +03:00
commit 8188b584aa
296 changed files with 22048 additions and 0 deletions

37
crates/uci/src/error.rs Normal file
View file

@ -0,0 +1,37 @@
use std::path::PathBuf;
use std::process::ExitStatus;
/// Errors returned by [`crate::Engine::spawn`] and the handle methods.
#[derive(Debug, thiserror::Error)]
pub enum EngineError {
#[error("engine executable not found: {0}")]
NotFound(PathBuf),
#[error("not an executable file: {path}: {reason}")]
NotExecutable { path: PathBuf, reason: String },
#[error("failed to start engine: {0}")]
Spawn(#[source] std::io::Error),
/// The program answered but did not speak UCI before the `uciok` timeout.
#[error("program does not look like a UCI engine")]
NotUci {
/// First lines of stdout, for diagnostics.
output: Vec<String>,
},
#[error("engine did not answer `{waiting_for}` in time")]
HandshakeTimeout { waiting_for: &'static str },
#[error("engine process exited during handshake ({status:?})")]
ProcessExited {
status: Option<ExitStatus>,
stderr: Vec<String>,
},
#[error("I/O error talking to engine: {0}")]
Io(#[source] std::io::Error),
#[error("invalid input: {0}")]
InvalidInput(String),
#[error("engine does not declare option {0:?}")]
UnknownOption(String),
#[error("invalid value for option {name:?}: {reason}")]
InvalidOptionValue { name: String, reason: String },
/// The engine process is no longer running (quit, crashed, killed as hung).
#[error("engine is not running")]
NotRunning,
}