[−][src]Struct weldr::SourceFile
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]
Notable traits for CommandIterator<'a>
impl<'a> Iterator for CommandIterator<'a> type Item = (DrawContext, &'a Command);
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]
&'a self,
source_map: &'a SourceMap
) -> LocalCommandIterator<'a>ⓘ
Notable traits for LocalCommandIterator<'a>
impl<'a> Iterator for LocalCommandIterator<'a> type Item = &'a Command;
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]
pub fn eq(&self, other: &SourceFile) -> bool
[src]
pub fn ne(&self, other: &SourceFile) -> bool
[src]
impl StructuralPartialEq for SourceFile
[src]
Auto Trait Implementations
impl RefUnwindSafe for SourceFile
impl Send for SourceFile
impl Sync for SourceFile
impl Unpin for SourceFile
impl UnwindSafe for SourceFile
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,
pub 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, 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.
pub 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>,