Struct quickmd::assets::Assets [−][src]
pub struct Assets { /* fields omitted */ }
Expand description
A container for static assets.
Builds everything in either the explicitly-given directory, or a temporary one. Internally reference-counted, so clones share the same storage.
Implementations
Create a new instance. It should never be necessary to create more than one, but it’s possible.
If the optional output_dir
parameter is not given, the instance will use a temporary
directory.
If output_dir
doesn’t exist, it will be recursively created.
Given an HTML fragment, wrap it up in whatever is necessary to turn it into a proper preview page and write it to a file.
Input:
content
: The rendered HTML to write to a file, with some additional metadata.page_state
: Client-side data to embed in the document, so it can read it via javascript and maintain continuity with the previous load.
Returns the path to the generated HTML file, or an error.
The path on the filesystem where the HTML and other assets go. Could be a temporary directory, or the one given at construction time.
Delete the temporary directory used for building assets, if there is one. This should happen automatically on drop, but a GTK-level exit doesn’t seem to unroll the stack, so we may need to delete things explicitly.
If deletion fails, we quietly print a warning. Multiple (successful or failed) deletions are a noop.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Assets
impl UnwindSafe for Assets
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V