Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }
Expand description

Base file plus overlay.

Implementations§

Source§

impl Store

Source

pub fn file(&self) -> &File

The base file.

Source

pub fn trailer(&self) -> &Dict

The working trailer: the base trailer plus edits.

Source

pub fn set_trailer_entry(&mut self, key: &str, value: Object)

Sets a trailer entry (/Info, /Root, /ID). null removes it.

Source

pub fn is_modified(&self) -> bool

Whether anything was changed.

Source

pub fn get(&self, id: ObjId) -> Result<Arc<Object>, Error>

The object id, from the overlay or the base.

Source

pub fn resolve(&self, object: &Object) -> Object

Follows references until a direct object; missing objects and overlong chains resolve to null.

Source

pub fn resolve_dict(&self, object: &Object) -> Option<Dict>

Resolves object as a dictionary (or a stream’s dictionary).

Source

pub fn decode_stream(&self, stream: &Stream) -> Result<Decoded, Error>

Decodes a stream through its filters, resolving indirect filter parameters through the overlay.

Source

pub fn object_ids(&self) -> Vec<ObjId>

Every live object id, base and overlay, in order.

Source

pub fn set(&mut self, id: ObjId, object: Object)

Replaces (or adds) object id.

Source

pub fn add(&mut self, object: Object) -> Result<ObjId, Error>

Adds a new object and returns its id.

Source

pub fn allocate(&mut self) -> Result<ObjId, Error>

Reserves a new object number (generation 0) without an object yet; Store::set fills it. Used to break cycles while copying.

Source

pub fn delete(&mut self, id: ObjId)

Deletes object id.

Source

pub fn next_number(&self) -> u32

The next object number that would be allocated.

Source

pub fn limits(&self) -> &Limits

The limits in force.

Source

pub fn strictness(&self) -> Strictness

Whether repairs are allowed.

Source

pub fn diagnostics_sink(&self) -> &Diagnostics

Where repairs are recorded.

Trait Implementations§

Source§

impl Debug for Store

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl !UnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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> ErasedDestructor for T
where T: 'static,

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> Same for T

Source§

type Output = T

Should always be Self
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.