pub enum DocumentError {
ReadFailed {
path: String,
},
InvalidFormat,
TooLarge {
size: usize,
max_size: usize,
},
ParseFailed {
reason: String,
},
InvalidEncoding {
path: String,
},
}
Expand description
Specialized error type for document-related operations
Variants§
ReadFailed
Failed to read document from file
InvalidFormat
Document format is invalid or unsupported
TooLarge
Document exceeds size limits
ParseFailed
Document parsing failed
InvalidEncoding
Invalid encoding detected
Implementations§
Source§impl DocumentError
Convenience constructors for document errors
impl DocumentError
Convenience constructors for document errors
Sourcepub fn read_failed(path: impl Into<String>) -> Self
pub fn read_failed(path: impl Into<String>) -> Self
Create a read failed error
Sourcepub fn parse_failed(reason: impl Into<String>) -> Self
pub fn parse_failed(reason: impl Into<String>) -> Self
Create a parse failed error
Sourcepub fn invalid_encoding(path: impl Into<String>) -> Self
pub fn invalid_encoding(path: impl Into<String>) -> Self
Create an invalid encoding error
Trait Implementations§
Source§impl Debug for DocumentError
impl Debug for DocumentError
Source§impl Display for DocumentError
impl Display for DocumentError
Source§impl Error for DocumentError
impl Error for DocumentError
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 DocumentError
impl RefUnwindSafe for DocumentError
impl Send for DocumentError
impl Sync for DocumentError
impl Unpin for DocumentError
impl UnwindSafe for DocumentError
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