pub struct Update<'a> { /* private fields */ }Expand description
the changes to one document, written by save() as an incremental update
Implementations§
Source§impl Update<'_>
impl Update<'_>
Sourcepub fn set_fonts(&mut self, fonts: Rc<dyn FontSource>)
pub fn set_fonts(&mut self, fonts: Rc<dyn FontSource>)
where fallback fonts come from (SystemFonts by default)
Sourcepub fn set_lang(&mut self, lang: &str)
pub fn set_lang(&mut self, lang: &str)
the language of Han characters in values (zh-Hans, zh-Hant, ja, ko; else the document’s /Lang)
Source§impl<'a> Update<'a>
impl<'a> Update<'a>
Sourcepub fn get(&self, r: Ref) -> Object
pub fn get(&self, r: Ref) -> Object
an object as the update will have it: changed, added, or as in the file (Null when deleted or missing; a stream added here gives its dictionary)
Sourcepub fn resolve(&self, o: &Object) -> Object
pub fn resolve(&self, o: &Object) -> Object
follow references until an object that is none (Null after too many)
Sourcepub fn add(&mut self, o: Object) -> Result<Ref, Error>
pub fn add(&mut self, o: Object) -> Result<Ref, Error>
a new object (not a stream: add_stream), and its reference
Sourcepub fn add_stream(&mut self, dict: Dict, data: &[u8]) -> Result<Ref, Error>
pub fn add_stream(&mut self, dict: Dict, data: &[u8]) -> Result<Ref, Error>
a new stream of data, compressed with FlateDecode (dict: its other keys)
Sourcepub fn add_stream_raw(
&mut self,
dict: Dict,
encoded: Vec<u8>,
) -> Result<Ref, Error>
pub fn add_stream_raw( &mut self, dict: Dict, encoded: Vec<u8>, ) -> Result<Ref, Error>
a new stream whose data is encoded already as the filters of dict say
Sourcepub fn set(&mut self, r: Ref, o: Object) -> Result<(), Error>
pub fn set(&mut self, r: Ref, o: Object) -> Result<(), Error>
object r becomes o. A stream from the document keeps its data (decrypted first when
it was another object’s)
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Update<'a>
impl<'a> !Send for Update<'a>
impl<'a> !Sync for Update<'a>
impl<'a> !UnwindSafe for Update<'a>
impl<'a> Forget for Update<'a>
impl<'a> Freeze for Update<'a>where
&'a Document: Freeze,
*const LeafNode<u32, (u16, Item)> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(u32, (u16, Item))>>: Freeze,
*const RcInner<dyn FontSource> is !null: Freeze,
PhantomData<RcInner<dyn FontSource>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<FontData>: Freeze,
PhantomData<(String, [Ref; 5])>: Freeze,
PhantomData<Journal>: Freeze,
impl<'a> Move for Update<'a>
impl<'a> Unpin for Update<'a>where
&'a Document: Unpin,
*const LeafNode<u32, (u16, Item)> is !null: Unpin,
Box<(u32, (u16, Item))>: Unpin,
Rc<dyn FontSource>: Unpin,
*const u8 is !null: Unpin,
Arc<SharedFontRepr>: Unpin,
Arc<VariedInstance>: Unpin,
*const LeafNode<u16, Option<String>> is !null: Unpin,
Box<(u16, Option<String>)>: Unpin,
*const LeafNode<u32, Option<(u16, Item)>> is !null: Unpin,
Box<(u32, Option<(u16, Item)>)>: Unpin,
impl<'a> UnsafeUnpin for Update<'a>where
&'a Document: UnsafeUnpin,
*const LeafNode<u32, (u16, Item)> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(u32, (u16, Item))>>: UnsafeUnpin,
*const RcInner<dyn FontSource> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn FontSource>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<FontData>: UnsafeUnpin,
PhantomData<(String, [Ref; 5])>: UnsafeUnpin,
PhantomData<Journal>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more