pub struct Reference<T> {
pub id: ReferenceId,
/* private fields */
}Expand description
A PDF reference to an indirect object.
In Livre, the Reference object is generic over the type of the indirect object, making the
entire interface type-safe. You can “opt out” of type safety by using an
Object type, which can represent any PDF object.
PDF documents resort to a “random access” strategy to limit repetition and split large objects
into smaller atoms. Indirect objects are also used when a property cannot be known in advance.
For instance, in the general case a PDF generator may choose to represent the Length key in
the Stream dictionary with an indirect object to allow writing
the content to disk without having to know the serialised length in advance.
To that end, some objects are represented by a Reference, indicating the object ID
as well as the generation number. These are represented together in Livre, through the
ReferenceId type.
In practice, it looks like the generation number is not useful unless we are interested in retrieving the PDF history. Livre tracks it in case we want to develop that capability down the line.
Fields§
§id: ReferenceIdTrait Implementations§
Source§impl<T> Clone for Reference<T>
We need to implement the Clone trait manually because of the automatic trait bound on T.
impl<T> Clone for Reference<T>
We need to implement the Clone trait manually because of the automatic trait bound on T.