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
fn path(&self) -> &Path
Returns a &Path
representing the location on disk to write the
document to
fn url(&self) -> &Url
Returns a &Url
representing the location of the document on the
interwebs :)
fn wkhtmltopdf(&self) -> bool
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.
fn set_bytes(&mut self, bytes: Option<Vec<u8>>)
Enables setting raw bytes of the object after they have been downloaded.
Implementors
impl Document for SimpleDocument