Trait urls2disk::Document [] [src]

pub trait Document {
    fn path(&self) -> &Path;
fn url(&self) -> &Url;
fn wkhtmltopdf(&self) -> bool;
fn set_bytes(&mut self, bytes: Option<Vec<u8>>); }

Document is a trait for representing objects that can be downloaded and written to disk using the Client struct. If an object implementing Document returns true from its wkhtmltopdf() method, it will be converted to PDF before it is written to disk.

Required Methods

Returns a &Path representing the location on disk to write the document to

Returns a &Url representing the location of the document on the interwebs :)

Returns a bool representing whether or not the document should be converted to pdf using wkhtmltopdf before being written to disk. true means you would like the document to be converted using wkhtmltopdf before being written to disk. false means you would like to write raw bytes only.

Enables setting raw bytes of the object after they have been downloaded.

Implementors