pub enum ScanError {
Io(Error),
DirectoryNotFound {
path: String,
},
MissingMetadata {
path: String,
},
MetadataParse {
path: String,
source: Error,
},
UnsupportedSchema {
found: u32,
expected: u32,
},
TooManyFiles {
count: usize,
limit: usize,
},
FileTooLarge {
path: String,
size: u64,
limit: u64,
},
StaleMetadata {
tool: String,
expected_file: String,
sidecar_path: String,
},
}Expand description
Errors that can occur while scanning a server directory for its _meta.json sidecar.
Variants§
Io(Error)
I/O error reading the directory or sidecar file.
DirectoryNotFound
Directory does not exist.
MissingMetadata
The _meta.json sidecar is missing from the server directory.
MetadataParse
The _meta.json sidecar could not be parsed as valid ServerMetadata JSON.
Fields
UnsupportedSchema
The sidecar’s schema_version does not match the version this crate understands.
Fields
TooManyFiles
Too many tools in the sidecar (denial-of-service protection).
Fields
FileTooLarge
Sidecar file too large to process.
Fields
StaleMetadata
A tool listed in the _meta.json sidecar has no corresponding .ts
file on disk.
This indicates the sidecar and the generated TypeScript files have
drifted apart — e.g. the file was deleted manually, or a generate
run was interrupted before writing it.
Trait Implementations§
Source§impl Error for ScanError
impl Error for ScanError
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 ScanError
impl !UnwindSafe for ScanError
impl Freeze for ScanError
impl Send for ScanError
impl Sync for ScanError
impl Unpin for ScanError
impl UnsafeUnpin for ScanError
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