pub struct PageArchive {
pub url: Url,
pub content: String,
pub resource_map: ResourceMap,
}
Expand description
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§
Source§impl PageArchive
impl PageArchive
Sourcepub fn embed_resources(&self) -> String
pub fn embed_resources(&self) -> String
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 originalsrc
attribute is deleted.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageArchive
impl RefUnwindSafe for PageArchive
impl Send for PageArchive
impl Sync for PageArchive
impl Unpin for PageArchive
impl UnwindSafe for PageArchive
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