Struct web_archive::page_archive::PageArchive[][src]

pub struct PageArchive {
    pub url: Url,
    pub content: String,
    pub resource_map: ResourceMap,
}

Intermediate struct storing the downloaded resources

Fields

url: Url

Base URL of the page being archived

content: String

The content/body of the page

resource_map: ResourceMap

A mapping of resource URLs to the downloaded resources

Implementations

impl PageArchive[src]

pub fn embed_resources(&self) -> String[src]

Searches img, link, and script tags in the page body and substitutes in the downloaded content.

  • Images are base-64 encoded and inserted as data: URIs
  • Stylesheets are inserted as inline <style> tags, replacing the <link> tags they originated from
  • Scripts are inserted into their originating <script> tags and the original src attribute is deleted.

pub fn write_to_disk<P: AsRef<Path>>(
    &self,
    _output_dir: &P
) -> Result<(), Error>
[src]

NOT YET IMPLEMENTED

Write the downloaded resources to disk in the directory specified

Trait Implementations

impl Debug for PageArchive[src]

Auto Trait Implementations

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

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.