[][src]Struct lopdf::Stream

pub struct Stream {
    pub dict: Dictionary,
    pub content: Vec<u8>,
    pub allows_compression: bool,
    pub start_position: Option<usize>,
}

Stream object Warning - all streams must be indirect objects, while the stream dictionary may be a direct object

Fields

dict: Dictionary

Associated stream dictionary

content: Vec<u8>

Contents of the stream in bytes

allows_compression: bool

Can the stream be compressed by the Document::compress() function? Font streams may not be compressed, for example

start_position: Option<usize>

Stream data's position in PDF file.

Implementations

impl Stream[src]

pub fn new(dict: Dictionary, content: Vec<u8>) -> Stream[src]

pub fn with_position(dict: Dictionary, position: usize) -> Stream[src]

pub fn with_compression(self, allows_compression: bool) -> Stream[src]

Default is that the stream may be compressed. On font streams, set this to false, otherwise the font will be corrupt

pub fn filter(&self) -> Result<String>[src]

pub fn filters(&self) -> Result<Vec<String>>[src]

pub fn set_content(&mut self, content: Vec<u8>)[src]

pub fn set_plain_content(&mut self, content: Vec<u8>)[src]

pub fn compress(&mut self) -> Result<()>[src]

pub fn decompressed_content(&self) -> Result<Vec<u8>>[src]

pub fn decompress(&mut self)[src]

impl Stream[src]

pub fn decode_content(&self) -> Result<Content>[src]

Decode content after decoding all stream filters.

Trait Implementations

impl Clone for Stream[src]

impl Debug for Stream[src]

impl From<Stream> for Object[src]

Auto Trait Implementations

impl RefUnwindSafe for Stream

impl Send for Stream

impl Sync for Stream

impl Unpin for Stream

impl UnwindSafe for Stream

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.