pub struct Stream { /* private fields */ }Expand description
A stream object: a dictionary plus the raw bytes between stream and
endstream.
The data is kept exactly as it appears in the file — still encoded, still
encrypted if the document is. Decoding is the filter layer’s job (Q4);
decryption is Q9’s, and both use Stream::set_data so that /Length
never drifts away from the bytes.
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn new(dict: Dictionary, data: impl Into<Vec<u8>>) -> Self
pub fn new(dict: Dictionary, data: impl Into<Vec<u8>>) -> Self
A stream from a dictionary and its raw data.
/Length is not rewritten here: the dictionary is used exactly as
given, which is what a parsed stream needs for a byte-exact write-back.
Sourcepub fn dict(&self) -> &Dictionary
pub fn dict(&self) -> &Dictionary
The stream dictionary.
Sourcepub fn dict_mut(&mut self) -> &mut Dictionary
pub fn dict_mut(&mut self) -> &mut Dictionary
The stream dictionary, for in-place edits.
Trait Implementations§
impl StructuralPartialEq for Stream
Auto Trait Implementations§
impl Forget for Stream
impl Freeze for Stream
impl Move for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl UnwindSafe for Stream
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