pub enum Error {
Io(Error),
InvalidMagic {
expected: [u8; 4],
found: [u8; 4],
},
InvalidChunkSize {
chunk: String,
expected: usize,
found: usize,
},
InvalidVersion(u32),
MissingChunk(String),
InvalidChunkData {
chunk: String,
message: String,
},
ConversionError {
from: String,
to: String,
reason: String,
},
ValidationError(String),
UnsupportedFeature {
feature: String,
version: String,
},
StringError {
context: String,
message: String,
},
SizeLimit {
size: usize,
limit: usize,
context: String,
},
}Expand description
Errors that can occur during WDT operations
Variants§
Io(Error)
I/O error occurred
InvalidMagic
Invalid magic bytes for a chunk
InvalidChunkSize
Unexpected chunk size
InvalidVersion(u32)
Invalid WDT version
MissingChunk(String)
Missing required chunk
InvalidChunkData
Invalid data within a chunk
ConversionError
Version conversion error
ValidationError(String)
Validation error
UnsupportedFeature
Unsupported feature for version
StringError
String encoding error
SizeLimit
File size exceeded limit
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_magic_str(
_chunk: &str,
expected: &[u8; 4],
found: &[u8; 4],
) -> Self
pub fn invalid_magic_str( _chunk: &str, expected: &[u8; 4], found: &[u8; 4], ) -> Self
Create an invalid magic error with chunk name
Sourcepub fn invalid_data(
chunk: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_data( chunk: impl Into<String>, message: impl Into<String>, ) -> Self
Create an invalid chunk data error
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a validation error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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