pub enum MarkedContentValue {
String(Vec<u8>),
Integer(i64),
Real(f64),
Name(String),
Array(Vec<MarkedContentValue>),
Dict(HashMap<String, MarkedContentValue>),
}Expand description
A single value inside a marked-content properties dictionary or array.
PDF marked-content properties (BDC, DP) carry typed values: strings,
integers, real numbers, names, arrays, and nested dictionaries. The
previous HashMap<String, String> carrier was lossy for /ActualText
(UTF-16BE bytes mangled by String::from_utf8_lossy) and for /MCID
(integer values stored as their decimal string representation). This
enum preserves the original token type and bytes; decoding happens
lazily at the extractor level (e.g. UTF-16BE detection via BOM).
Hex strings (<FEFF00660069>) and literal strings ((text)) both
land here as MarkedContentValue::String(Vec<u8>) because both are
raw byte sequences at the PDF tokenizer level.
Variants§
String(Vec<u8>)
Raw PDF string bytes (from either Token::String or Token::HexString).
Decoded lazily by consumers — UTF-16BE detection via BOM happens in the
extractor’s decode_pdf_string helper.
Integer(i64)
PDF integer (e.g. /MCID 0).
Real(f64)
PDF real number.
Name(String)
PDF name token (e.g. /Pagination).
Array(Vec<MarkedContentValue>)
PDF array; nested values are themselves MarkedContentValue.
Dict(HashMap<String, MarkedContentValue>)
Nested dictionary; keys are PDF name strings (the leading / is stripped).
Trait Implementations§
Source§impl Clone for MarkedContentValue
impl Clone for MarkedContentValue
Source§fn clone(&self) -> MarkedContentValue
fn clone(&self) -> MarkedContentValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MarkedContentValue
impl Debug for MarkedContentValue
Source§impl PartialEq for MarkedContentValue
impl PartialEq for MarkedContentValue
Source§fn eq(&self, other: &MarkedContentValue) -> bool
fn eq(&self, other: &MarkedContentValue) -> bool
self and other values to be equal, and is used by ==.