[][src]Struct hltas::types::HLTAS

pub struct HLTAS<'a> {
    pub properties: Properties<'a>,
    pub lines: Vec<Line<'a>>,
}

A HLTAS script.

Fields

properties: Properties<'a>

Properties before the frames section.

lines: Vec<Line<'a>>

Contents of the frames section.

Methods

impl<'a> HLTAS<'a>[src]

pub fn from_str(input: &'a str) -> Result<Self, Error>[src]

Parses a .hltas script.

Examples

use std::fs::read_to_string;
use hltas::HLTAS;

let contents = read_to_string("script.hltas")?;
match HLTAS::from_str(&contents) {
    Ok(hltas) => { /* ... */ }

    // The errors are pretty-printed with context.
    Err(error) => println!("{}", error),
}

pub fn to_writer<W: Write>(&self, writer: W) -> Result<(), GenError>[src]

Outputs the script in the .hltas format.

Examples

use std::fs::File;
use hltas::HLTAS;

fn save_script(hltas: &HLTAS) -> Result<(), Box<dyn std::error::Error>> {
    let file = File::create("script.hltas")?;
    hltas.to_writer(file)?;
    Ok(())
}

Trait Implementations

impl<'a> Clone for HLTAS<'a>[src]

impl<'a> Debug for HLTAS<'a>[src]

impl<'a> Default for HLTAS<'a>[src]

impl<'a> PartialEq<HLTAS<'a>> for HLTAS<'a>[src]

impl<'a> StructuralPartialEq for HLTAS<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for HLTAS<'a>

impl<'a> Send for HLTAS<'a>

impl<'a> Sync for HLTAS<'a>

impl<'a> Unpin for HLTAS<'a>

impl<'a> UnwindSafe for HLTAS<'a>

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.