Skip to main content

Overlay

Struct Overlay 

Source
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

Source

pub fn new(base: OverlayBase) -> Overlay

An empty update section over base, numbering new objects from its first free number.

Source

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.

Source

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.

Source

pub fn reserve(&mut self) -> ObjRef

Allocates the next free object number without storing anything under it yet.

Source

pub fn put(&mut self, obj: Object) -> ObjRef

Adds a new object under the next free number.

Source

pub fn set_info(&mut self, r: ObjRef)

Registers the document information dictionary for the appended section’s trailer, overriding the base’s own.

Source

pub fn is_empty(&self) -> bool

Whether nothing has been set or removed yet.

Source

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.

Trait Implementations§

Source§

impl Clone for Overlay

Source§

fn clone(&self) -> Overlay

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Overlay

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.