pub struct PdfString {
pub bytes: Box<[u8]>,
pub hex: bool,
}Expand description
A PDF string object: raw bytes plus the syntax they were written in.
use pdfrum_object::PdfString;
let s = PdfString::literal(b"A simple test");
assert_eq!(s.as_text(), "A simple test");
assert!(!s.hex);
// A UTF-16BE byte-order mark selects the Unicode reading.
let unicode = PdfString::hex(b"\xFE\xFF\x03\x30\x03\x31");
assert_eq!(unicode.as_text(), "\u{0330}\u{0331}");
assert!(unicode.hex);Fields§
§bytes: Box<[u8]>The string’s bytes, escapes already resolved.
hex: boolWhether the source syntax was <hex> rather than (literal).
Round-tripped by the writer; never affects meaning.
Implementations§
Trait Implementations§
impl Eq for PdfString
impl StructuralPartialEq for PdfString
Auto Trait Implementations§
impl Freeze for PdfString
impl RefUnwindSafe for PdfString
impl Send for PdfString
impl Sync for PdfString
impl Unpin for PdfString
impl UnsafeUnpin for PdfString
impl UnwindSafe for PdfString
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