[][src]Struct weldr::SourceFile

pub struct SourceFile {
    pub filename: String,
    pub raw_content: Vec<u8>,
    pub cmds: Vec<Command>,
}

Single LDraw source file loaded and optionally parsed.

Fields

filename: String

The relative filename of the file as resolved.

raw_content: Vec<u8>

Raw UTF-8 file content (without BOM) loaded from the resolved file. Line ending can be Unix style \n or Windows style \r\n. As a convenience, parsing handles both indifferently, so the file can contain a mix of both, although this is not recommended.

cmds: Vec<Command>

LDraw commands parsed from the raw text content of the file.

Implementations

impl SourceFile[src]

pub fn iter<'a>(&'a self, source_map: &'a SourceMap) -> CommandIterator<'a>

Notable traits for CommandIterator<'a>

impl<'a> Iterator for CommandIterator<'a> type Item = (DrawContext, &'a Command);
[src]

Return an iterator over all drawing commands, recursively stepping into sub-file references without returning the corresponding SubFileRefCmd command nor any comment command.

pub fn local_iter<'a>(
    &'a self,
    source_map: &'a SourceMap
) -> LocalCommandIterator<'a>

Notable traits for LocalCommandIterator<'a>

impl<'a> Iterator for LocalCommandIterator<'a> type Item = &'a Command;
[src]

Return an iterator over all commands local to this source file, including sub-file references and comments. Unlike SourceFile::iter(), this doesn't step into those sub-file references but remains in the local source file.

Trait Implementations

impl Debug for SourceFile[src]

impl PartialEq<SourceFile> for SourceFile[src]

impl StructuralPartialEq for SourceFile[src]

Auto Trait Implementations

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, 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.