pub struct Overlay { /* private fields */ }Expand description
An update section under construction over an OverlayBase: which
objects it holds, new ones numbered from the base’s first free number.
Implementations§
Source§impl Overlay
impl Overlay
Sourcepub fn new(base: OverlayBase) -> Overlay
pub fn new(base: OverlayBase) -> Overlay
An empty update section over base, numbering new objects from its
first free number.
Sourcepub fn set(&mut self, r: ObjRef, obj: Object)
pub fn set(&mut self, r: ObjRef, obj: Object)
Sets an object under its own number, whether new or a replacement
of one already in the base. Raises the next free number past r
when r was not already reserved, so a later reserve/put never
collides with a caller-chosen number. A no-op for object number 0:
it is already the free list’s own permanent head, represented by
this section’s synthetic entry-0 row whenever any other object is
freed, and a set row for it would collide with that row. Symmetric
with Overlay::remove’s guard.
Sourcepub fn remove(&mut self, r: ObjRef)
pub fn remove(&mut self, r: ObjRef)
Marks r free: the appended section’s cross-reference data chains
it into entry 0’s free list, in whichever style the base uses. Its
generation for reuse is r.gen advanced by one (saturating at
65535, the field’s own limit), per the classic table’s convention
for a deleted entry’s row. A no-op for object number 0: it is
already the free list’s own permanent head, represented by this
section’s synthetic entry-0 row whenever any other object is freed.
Sourcepub fn reserve(&mut self) -> ObjRef
pub fn reserve(&mut self) -> ObjRef
Allocates the next free object number without storing anything under it yet.
Sourcepub fn set_info(&mut self, r: ObjRef)
pub fn set_info(&mut self, r: ObjRef)
Registers the document information dictionary for the appended section’s trailer, overriding the base’s own.
Sourcepub fn section(&self, start: u64) -> Result<Vec<u8>>
pub fn section(&self, start: u64) -> Result<Vec<u8>>
The appended section alone: every set object at start plus its
position within this section, then a cross-reference section in the
base’s style naming the base’s section as /Prev. Refused when no
object has been set. A number recorded more than once (repeated
set, or set and remove on the same reference) keeps only its
last-recorded change, so the appended cross-reference data never
carries two rows for one number.