#[non_exhaustive]pub enum Skeleton {
Text {
parts: Vec<SkelPart>,
encoding: String,
parser: Option<ParserInfo>,
},
Zip {
entries: Vec<ZipEntry>,
parser: Option<ParserInfo>,
},
Binary {
data: Vec<u8>,
parser: Option<ParserInfo>,
},
}Expand description
Everything in the file that is not translatable text. New kinds of skeleton come as new variants (match with a
wildcard arm); the fields of each variant are fixed for 1.x (a format records more in its parts, in the
encoding tag’s ;name=value items, or in Unit::hidden).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text
A text file: parts in order. encoding is what the writer must produce (“utf-8”, “utf-8-bom”, …).
Fields
encoding: StringThe encoding tag (the envelope of enc::decode_text: "utf-8", "windows-1252;nl=crlf", …).
parser: Option<ParserInfo>The parser that made it.
Zip
A zip container (DOCX, XLSX, PPTX, ODF, IDML): entries in their original order.
Fields
parser: Option<ParserInfo>The parser that made it.
Binary
A binary file kept whole (a compiled MO catalog): the writer rebuilds the file from these bytes and the units. In JSON the bytes are a base64 string.
Implementations§
Source§impl Skeleton
impl Skeleton
Sourcepub fn text(
parts: Vec<SkelPart>,
encoding: impl Into<String>,
parser: ParserInfo,
) -> Skeleton
pub fn text( parts: Vec<SkelPart>, encoding: impl Into<String>, parser: ParserInfo, ) -> Skeleton
A text skeleton stamped with the producing parser.
Sourcepub fn zip(entries: Vec<ZipEntry>, parser: ParserInfo) -> Skeleton
pub fn zip(entries: Vec<ZipEntry>, parser: ParserInfo) -> Skeleton
A zip skeleton stamped with the producing parser.
Sourcepub fn binary(data: Vec<u8>, parser: ParserInfo) -> Skeleton
pub fn binary(data: Vec<u8>, parser: ParserInfo) -> Skeleton
A binary skeleton stamped with the producing parser.
Sourcepub fn parser(&self) -> Option<&ParserInfo>
pub fn parser(&self) -> Option<&ParserInfo>
The parser that made this skeleton, if recorded.