#[non_exhaustive]pub enum Error {
Show 30 variants
BrokenPageList,
DuplicateCharCount {
line: Option<usize>,
},
DuplicateChar {
line: Option<usize>,
id: u32,
},
DuplicateCommonBlock {
line: Option<usize>,
},
DuplicateInfoBlock {
line: Option<usize>,
},
DuplicateKerningCount {
line: Option<usize>,
},
DuplicateKerningPair {
line: Option<usize>,
first: u32,
second: u32,
},
DuplicateKey {
line: Option<usize>,
key: String,
},
DuplicatePageId {
line: Option<usize>,
id: u32,
},
DuplicateTag {
line: Option<usize>,
tag: String,
},
IncongruentPageNameLen {
line: Option<usize>,
},
InvalidBinary {
magic_bytes: u32,
},
InvalidBinaryBlock {
id: u8,
},
InvalidCharsetEncoding {
unicode: bool,
charset: Charset,
},
InvalidCharCount {
specified: u32,
realized: usize,
},
InvalidCharPage {
char_id: u32,
page_id: u32,
},
InvalidKerningCount {
specified: u32,
realized: usize,
},
InvalidKerningChar {
id: u32,
},
InvalidKey {
line: Option<usize>,
key: String,
},
InvalidPageCount {
specified: u16,
realized: usize,
},
InvalidTag {
line: Option<usize>,
tag: String,
},
NoCommonBlock,
NoInfoBlock,
Parse {
line: Option<usize>,
entity: String,
err: String,
},
UnsafeValueString {
path: String,
value: String,
},
UnsupportedBinaryVersion {
version: u8,
},
UnsupportedEncoding {
line: Option<usize>,
entity: String,
err: String,
},
UnsupportedValueEncoding {
path: String,
value: String,
},
Internal {
err: String,
},
Io {
err: Error,
},
}Expand description
Crate errors.
Describes the various errors that may occur when encoding/ decoding/ manipulating BMFont data structures.
The list of variants may change over time. Other than Error::Io and Error::Internal you’ll probably not want to match against them.
From<bmfont_rs::Error> for std::io::Error is provided as a convenience.
The Error::Internal variant indicates malfunctioning library code and should be reported at the project repository home here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BrokenPageList
The specified page ids do not form a coherent/ sequential list (decode only).
DuplicateCharCount
Duplicate character count (decode only).
DuplicateChar
Duplicate character id.
DuplicateCommonBlock
Duplicate common block (decode only).
DuplicateInfoBlock
Duplicate info block (decode only).
DuplicateKerningCount
Duplicate kerning count (decode only).
DuplicateKerningPair
Duplicate kerning pair entry.
Fields
DuplicateKey
Duplicate tagged key value (decode only).
DuplicatePageId
Duplicate page id (decode only).
DuplicateTag
Duplicate tag (decode only).
IncongruentPageNameLen
Page name lengths are not all of the same size.
InvalidBinary
The input is not a valid BMFont binary file (decode only).
InvalidBinaryBlock
Invalid binary block (decode only).
InvalidCharsetEncoding
Invalid character set encoding.
InvalidCharCount
The specified character count does not match the number of realized characters (decode only).
InvalidCharPage
The specified character page does not exist.
InvalidKerningCount
The specified kerning pair count does not match the number of realized kerning pairs (decode only).
InvalidKerningChar
The specified kerning character does not exist.
InvalidKey
The tagged key name is not valid (decode only).
InvalidPageCount
The specified page count does not match the number of realized pages (decode only).
InvalidTag
The tag name is not valid (decode only).
NoCommonBlock
The common block is missing.
NoInfoBlock
The info block is missing.
Parse
There was an error parsing an entity.
Fields
UnsafeValueString
The value string contains potentially unsafe control characters.
UnsupportedBinaryVersion
The binary version is unsupported (decode only).
UnsupportedEncoding
The specified entity cannot be encoded.
Fields
UnsupportedValueEncoding
The value string contains characters that cannot be encoded.
Internal
Internal error. This should not occur.
Io
Io error.