pub struct Stream {
pub dict: Dict,
pub data: ByteSpan,
}Expand description
A stream object: a dictionary describing bytes, plus the bytes.
The data is the raw payload as it sits in the file — filters have not
been applied and encryption has, if the document was encrypted. Its length
is authoritative: a /Length in the dictionary that disagreed with the
bytes found before endstream was already repaired by the reader, which
leaves the dictionary untouched and records a diagnostic.
use pdfrum_object::{ByteSpan, Dict, Object, Stream, names};
let stream = Stream {
dict: Dict::from_pairs([(names::LENGTH.clone(), Object::Int(3))]),
data: ByteSpan::from(b"abc".to_vec()),
};
assert_eq!(&*stream.data, b"abc");Fields§
§dict: DictThe stream’s dictionary: /Length, /Filter, /DecodeParms, and
whatever the stream’s own type adds.
data: ByteSpanThe raw stream data.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Stream
Auto Trait Implementations§
impl !Freeze 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