[][src]Struct quickmd::assets::Assets

pub struct Assets { /* fields omitted */ }

A container for static assets.

Has a temporary directory where it builds everything. Internally reference-counted, so clones share the same storage.

Methods

impl Assets[src]

pub fn init() -> Result<Self, Error>[src]

Create a new instance. It should never be necessary to create more than one, but it's possible.

pub fn build(&self, html: &str, scroll_top: f64) -> Result<PathBuf>[src]

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:

  • html: The HTML fragment to write to a file
  • scroll_top: A scroll position to embed in the document, so it can read it via javascript and reposition itself.

Returns the path to the generated HTML file, or an error.

pub fn delete(&mut self)[src]

Delete all the storage for the structure. 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

impl Clone for Assets[src]

Auto Trait Implementations

impl !RefUnwindSafe for Assets

impl !Send for Assets

impl !Sync for Assets

impl Unpin for Assets

impl UnwindSafe for Assets

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,