pub enum Error {
EmptyFile,
NoHeader,
HeaderInvalidUTF8,
UnsupportedGeometryFormat,
HeaderIncomplete(u8),
InvalidHeaderValue,
InvalidGeometryCommand(u16),
ElementOutsideLayer,
UnexpectedEOF,
TypeMismatch,
}
Expand description
Errors encountered when parsing a CLI file
Variants
EmptyFile
File is too short to contain a CLI file.
NoHeader
File does not contain a header section.
HeaderInvalidUTF8
Header does not contain valid UTF-8.
UnsupportedGeometryFormat
The header indicates that this file contains an ASCII encoded geometry section. This library does not support his format at this time.
HeaderIncomplete(u8)
Header is missing a required element:
- 0: Indication of binary or ASCII geometry section
- 1: Units
- 2: Version
InvalidHeaderValue
A numeric header value could not be parsed.
InvalidGeometryCommand(u16)
One of 6 binary commands was expected in the next two bytes, instead, this value was found. Most likely the file is corrupted. It is possible the file contains commands not included in the CLI spec.
A bug in this library may also be present. Please consider submitting the .cli file in a PR. Thank you.
ElementOutsideLayer
The file in invalid because it has geometry elements in the geometry section before specifying the first layer.
UnexpectedEOF
An element in the geometry section indicated that more data was present but the EOF has been reached.
TypeMismatch
The CLIType
specified when declaring the CLI
parser does not match the data in the geometry section of the file.