Enum PdfObject

Source
pub enum PdfObject<'a> {
    Boolean(bool),
    Integer(i32),
    Real(f32),
    String(PdfString<'a>),
    Name(&'a [u8]),
    Array(Vec<PdfObject<'a>>),
    Dictionary(PdfUntypedDictionary<'a>),
    Stream(PdfStreamObject<'a>),
    Reference(PdfObjectIdentifier),
    Null,
}
Expand description

From section 7.3.1 of the PDF specification: “PDF includes eight basic types of objects: Boolean values, Integer and Real numbers, Strings, Names, Arrays, Dictionaries, Streams, and the null object”

Variants§

§

Boolean(bool)

Section 7.3.2: “Boolean objects represent the logical values of true and false. They appear in PDF files using the keywords true and false.”

§

Integer(i32)

Section 7.3.3: “Integer objects represent mathematical integers. Real objects represent mathematical real numbers. The range and precision of numbers may be limited by the internal representations used in the computer on which the conforming reader is running; Annex C gives these limits for typical implementations.”

Section C.2 specifies this as 32-bit signed integer.

§

Real(f32)

Section 7.3.3: “Real objects represent mathematical real numbers. The range and precision of numbers may be limited by the internal representations used in the computer on which the conforming reader is running; Annex C gives these limits for typical implementations.”

Section C.2 specifies this as 32-bit floating point number.

§

String(PdfString<'a>)

Section 7.3.3: “A string object shall consist of a series of zero or more bytes. String objects are not integer objects, but are stored in a more compact format. The length of a string may be subject to implementation limits; see Annex C.”

Annex C specifies the maximum string length as 32767.

§

Name(&'a [u8])

Section 7.3.5: “[..] a name object is an atomic symbol uniquely defined by a sequence of any characters (8-bit values) except null (character code 0). Uniquely defined means that any two name objects made up of the same sequence of characters denote the same object. Atomic means that a name has no internal structure; although it is defined by a sequence of characters, those characters are not considered elements of the name.”

§

Array(Vec<PdfObject<'a>>)

Section 7.3.6: “An array object is a one-dimensional collection of objects arranged sequentially. Unlike arrays in many other computer languages, PDF arrays may be heterogeneous; that is, an array’s elements may be any combination of numbers, strings, dictionaries, or any other objects, including other arrays. An array may have zero elements.”

§

Dictionary(PdfUntypedDictionary<'a>)

§

Stream(PdfStreamObject<'a>)

Section 7.3.8: “A stream object, like a string object, is a sequence of bytes. Furthermore, a stream may be of unlimited length, whereas a string shall be subject to an implementation limit. For this reason, objects with potentially large amounts of data, such as images and page descriptions, shall be represented as streams.”

§

Reference(PdfObjectIdentifier)

A reference to an indirect object, represented as “ R”.

§

Null

Trait Implementations§

Source§

impl Debug for PdfObject<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for PdfObject<'a>

Source§

fn eq(&self, other: &PdfObject<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for PdfObject<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for PdfObject<'a>

§

impl<'a> RefUnwindSafe for PdfObject<'a>

§

impl<'a> Send for PdfObject<'a>

§

impl<'a> Sync for PdfObject<'a>

§

impl<'a> Unpin for PdfObject<'a>

§

impl<'a> UnwindSafe for PdfObject<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.