[−][src]Struct quickmd::assets::Assets
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 filescroll_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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,