pub struct Stream<'a>(/* private fields */);Expand description
A stream of arbitrary data.
Implementations§
Source§impl<'a> Stream<'a>
impl<'a> Stream<'a>
Sourcepub fn raw_data(&self) -> Cow<'a, [u8]>
pub fn raw_data(&self) -> Cow<'a, [u8]>
Return the raw, decrypted data of the stream.
Stream filters will not be applied.
Sourcepub fn obj_id(&self) -> Option<ObjectIdentifier>
pub fn obj_id(&self) -> Option<ObjectIdentifier>
Return the object identifier of the stream, if available.
Returns None if the stream is corrupt and lacks an object ID.
Sourcepub fn decoded(&self) -> Result<Vec<u8>, DecodeFailure>
pub fn decoded(&self) -> Result<Vec<u8>, DecodeFailure>
Return the decoded data of the stream.
Note that the result of this method will not be cached, so calling it multiple times is expensive.
Like decoded, but decoded at most once per document
load and shared: the cache is keyed by object number and generation.
For data many pages read again unchanged, such as embedded font programs. Not for images, whose decode depends on parameters. A stream without an object id is decoded each time.
Sourcepub fn decoded_image(
&self,
image_params: &ImageDecodeParams,
) -> Result<FilterResult, DecodeFailure>
pub fn decoded_image( &self, image_params: &ImageDecodeParams, ) -> Result<FilterResult, DecodeFailure>
Return the decoded data of the stream, and return image metadata if available.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Stream<'a>
impl<'a> !UnwindSafe for Stream<'a>
impl<'a> Freeze for Stream<'a>
impl<'a> Send for Stream<'a>
impl<'a> Sync for Stream<'a>
impl<'a> Unpin for Stream<'a>
impl<'a> UnsafeUnpin for Stream<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> FromBytes<'a> for Twhere
T: Readable<'a>,
impl<'a, T> FromBytes<'a> for Twhere
T: Readable<'a>,
Source§fn from_bytes(b: &'a [u8]) -> Option<T>
fn from_bytes(b: &'a [u8]) -> Option<T>
Try to read the object from the given bytes.