plissken-core::error
Rust
Unified error types for plissken-core.
This module provides a single error enum that covers all error cases
in the library, replacing the previous mix of anyhow::Error,
tera::Error, and other error types.
enum PlisskenError
Section titled “enum PlisskenError”pub
The primary error type for plissken-core operations.
This enum covers all error categories that can occur during parsing, rendering, and configuration handling.
Variants
Section titled “Variants”ConfigNotFound- Configuration file not found at the expected path.ConfigParse- Failed to parse configuration file.ConfigValidation- Configuration validation failed.Parse- Failed to parse a source file.FileRead- Failed to read a source file.Template- Template rendering failed.OutputWrite- Failed to write output file.CrossRef- Cross-reference resolution failed.Io- Generic IO error with context.Discovery- Module discovery failed.ManifestParse- Failed to parse manifest file (Cargo.toml or pyproject.toml).
Methods
Section titled “Methods”rust_parse
Section titled “rust_parse”pub
fn rust_parse( path: impl Into<PathBuf>, message: impl Into<String>,) -> SelfCreate a parse error for a Rust file.
Source
pub fn rust_parse(path: impl Into<PathBuf>, message: impl Into<String>) -> Self { PlisskenError::Parse { language: "Rust".into(), path: path.into(), line: None, message: message.into(), } }rust_parse_at
Section titled “rust_parse_at”pub
fn rust_parse_at( path: impl Into<PathBuf>, line: usize, message: impl Into<String>,) -> SelfCreate a parse error for a Rust file with line number.
Source
pub fn rust_parse_at( path: impl Into<PathBuf>, line: usize, message: impl Into<String>, ) -> Self { PlisskenError::Parse { language: "Rust".into(), path: path.into(), line: Some(line), message: message.into(), } }python_parse
Section titled “python_parse”pub
fn python_parse( path: impl Into<PathBuf>, message: impl Into<String>,) -> SelfCreate a parse error for a Python file.
Source
pub fn python_parse(path: impl Into<PathBuf>, message: impl Into<String>) -> Self { PlisskenError::Parse { language: "Python".into(), path: path.into(), line: None, message: message.into(), } }python_parse_at
Section titled “python_parse_at”pub
fn python_parse_at( path: impl Into<PathBuf>, line: usize, message: impl Into<String>,) -> SelfCreate a parse error for a Python file with line number.
Source
pub fn python_parse_at( path: impl Into<PathBuf>, line: usize, message: impl Into<String>, ) -> Self { PlisskenError::Parse { language: "Python".into(), path: path.into(), line: Some(line), message: message.into(), } }file_read
Section titled “file_read”pub
fn file_read(path: impl Into<PathBuf>, source: std::io::Error) -> SelfCreate a file read error.
Source
pub fn file_read(path: impl Into<PathBuf>, source: std::io::Error) -> Self { let path = path.into(); PlisskenError::FileRead { message: source.to_string(), path, source, } }pub
fn io(context: impl Into<String>, source: std::io::Error) -> SelfCreate an IO error with context.
Source
pub fn io(context: impl Into<String>, source: std::io::Error) -> Self { PlisskenError::Io { context: context.into(), source, } }config_not_found
Section titled “config_not_found”pub
fn config_not_found(path: impl Into<PathBuf>) -> SelfCreate a config not found error.
Source
pub fn config_not_found(path: impl Into<PathBuf>) -> Self { PlisskenError::ConfigNotFound { path: path.into() } }discovery
Section titled “discovery”pub
fn discovery( path: impl Into<PathBuf>, message: impl Into<String>,) -> SelfCreate a discovery error.
Source
pub fn discovery(path: impl Into<PathBuf>, message: impl Into<String>) -> Self { PlisskenError::Discovery { path: path.into(), message: message.into(), } }Type aliases
Section titled “Type aliases”| Name | Type | Description |
|---|---|---|
Result<T> |
std::result::Result<T, PlisskenError> |
A specialized Result type for plissken operations. |
