[][src]Struct latexcompile::LatexInput

pub struct LatexInput { /* fields omitted */ }

The latex input provides the needed files as tuple vector with name, buffer as tuple.

Methods

impl LatexInput
[src]

pub fn new() -> LatexInput
[src]

pub fn add(&mut self, name: &str, buf: Vec<u8>)
[src]

Add a single input tuple.

Example

fn main() {
  let mut input = LatexInput::new();
  input.add("name.tex", "test".as_bytes().to_vec());
}

pub fn add_file(&mut self, file: PathBuf) -> Result<(), LatexError>
[src]

Add a single file as input.

Example

fn main() {
  let mut input = LatexInput::from("assets/main.tex");
  input.add("name.tex", "test".as_bytes().to_vec());
}

Note

If the path is not a file or can't be converted to a string nothing is added and ok is returned.

pub fn add_folder(&mut self, folder: PathBuf) -> Result<(), LatexError>
[src]

Add a whole folder as input.

Example

fn main() {
  let mut input = LatexInput::from("assets");
  input.add("name.tex", "test".as_bytes().to_vec());
}

Note

If the path is not a folder nothing is added.

Trait Implementations

impl<'a> From<&'a str> for LatexInput
[src]

Provide a simple From conversion for &str to latex input. If neither a valid file nor a folder an empty input struct is returned.

impl PartialEq<LatexInput> for LatexInput
[src]

impl Debug for LatexInput
[src]

Auto Trait Implementations

impl Send for LatexInput

impl Sync for LatexInput

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.