#[non_exhaustive]pub enum Error {
FileRead {
path: PathBuf,
source: Error,
},
FileWrite {
path: PathBuf,
source: Error,
},
DirectoryCreate {
path: PathBuf,
source: Error,
},
PathTraversal {
path: PathBuf,
},
InvalidWireFormat {
offset: usize,
details: String,
},
VarintDecode {
offset: usize,
},
DescriptorParse(DecodeError),
DescriptorBuild(String),
NoDescriptorsFound,
InvalidFieldNumber {
number: u32,
max: u32,
},
UnsupportedSyntax {
syntax: String,
},
Internal(String),
}Expand description
Comprehensive error type for all zarja operations
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FileRead
Failed to read input file
FileWrite
Failed to write output file
DirectoryCreate
Failed to create output directory
PathTraversal
Path traversal attempt detected (security error)
InvalidWireFormat
Invalid protobuf wire format
Fields
VarintDecode
Failed to decode varint
DescriptorParse(DecodeError)
Failed to parse FileDescriptorProto
DescriptorBuild(String)
Failed to build file descriptor with prost-reflect
NoDescriptorsFound
No descriptors found in input
InvalidFieldNumber
Invalid field number in descriptor
UnsupportedSyntax
Unsupported proto syntax version
Internal(String)
Generic internal error
Implementations§
Source§impl Error
impl Error
Sourcepub fn file_read(path: impl Into<PathBuf>, source: Error) -> Self
pub fn file_read(path: impl Into<PathBuf>, source: Error) -> Self
Creates a new file read error
Sourcepub fn file_write(path: impl Into<PathBuf>, source: Error) -> Self
pub fn file_write(path: impl Into<PathBuf>, source: Error) -> Self
Creates a new file write error
Sourcepub fn directory_create(path: impl Into<PathBuf>, source: Error) -> Self
pub fn directory_create(path: impl Into<PathBuf>, source: Error) -> Self
Creates a new directory creation error
Sourcepub fn path_traversal(path: impl Into<PathBuf>) -> Self
pub fn path_traversal(path: impl Into<PathBuf>) -> Self
Creates a new path traversal error
Sourcepub fn invalid_wire_format(offset: usize, details: impl Into<String>) -> Self
pub fn invalid_wire_format(offset: usize, details: impl Into<String>) -> Self
Creates a new wire format error
Sourcepub fn varint_decode(offset: usize) -> Self
pub fn varint_decode(offset: usize) -> Self
Creates a new varint decode error
Sourcepub fn descriptor_build(msg: impl Into<String>) -> Self
pub fn descriptor_build(msg: impl Into<String>) -> Self
Creates a new descriptor build error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Returns true if this is a recoverable error that should be skipped
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()
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe 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