pub enum BspParseError {
InvalidPaletteLength(usize),
LumpOutOfBounds(LumpEntry),
BufferOutOfBounds {
from: usize,
to: usize,
size: usize,
},
InvalidString {
index: usize,
sequence: Vec<u8>,
},
WrongMagicNumber {
found: [u8; 4],
expected: &'static str,
},
UnsupportedIbspVersion {
found: u32,
expected: &'static str,
},
ColorDataSizeNotDevisableBy3(usize),
InvalidVariant {
value: i32,
acceptable: &'static str,
},
NoBspxDirectory,
NoBspxLump(String),
DoingJob(String, Box<BspParseError>),
}Variants§
InvalidPaletteLength(usize)
LumpOutOfBounds(LumpEntry)
BufferOutOfBounds
InvalidString
WrongMagicNumber
UnsupportedIbspVersion
ColorDataSizeNotDevisableBy3(usize)
InvalidVariant
NoBspxDirectory
This is to be gracefully handled in-crate.
NoBspxLump(String)
DoingJob(String, Box<BspParseError>)
For telling the user exactly where the error occurred in the process.
Implementations§
Source§impl BspParseError
impl BspParseError
Sourcepub fn root(&self) -> &BspParseError
pub fn root(&self) -> &BspParseError
The error error behind any BspParseError::DoingJob.
pub fn map_utf8_error(data: &[u8]) -> impl FnOnce(Utf8Error) -> Self + '_
Trait Implementations§
Source§impl Clone for BspParseError
impl Clone for BspParseError
Source§fn clone(&self) -> BspParseError
fn clone(&self) -> BspParseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BspParseError
impl Debug for BspParseError
Source§impl Display for BspParseError
impl Display for BspParseError
Source§impl Error for BspParseError
impl Error for BspParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for BspParseError
impl RefUnwindSafe for BspParseError
impl Send for BspParseError
impl Sync for BspParseError
impl Unpin for BspParseError
impl UnwindSafe for BspParseError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more