Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
906 B · 33 lines
Rust
at main
12345678910111213141516171819202122232425262728293031323334use core::error::Error;use core::fmt::{self, Display};
// This should be a different enum per part of file. Either return a list of these or take a callback// TODO: https://users.rust-lang.org/t/validation-monad/117894/6//// load was partially successful. These are the defects that are in the now loaded project// #[derive(Debug, Clone, Copy)]// #[non_exhaustive]// pub enum LoadDefect {// /// deletes the effect// UnknownEffect,// /// replaced with empty text// InvalidText,// /// tries to replace with a sane default value// OutOfBoundsValue,// /// skips loading of the pointed to value// OutOfBoundsPtr,// }
#[derive(Debug)]pub enum LoadErr { CantReadFile, Invalid, BufferTooShort,}impl Display for LoadErr { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{self:?}") }}
impl Error for LoadErr {}