pub struct SourceMap {
pub pieces: Vec<SourcePiece>,
}Expand description
The pieces of a concatenated script, in the order they were joined.
Fields§
§pieces: Vec<SourcePiece>Every piece, ascending by SourcePiece::at.
Implementations§
Source§impl SourceMap
impl SourceMap
Sourcepub fn append(
&mut self,
text: &mut String,
body: &str,
file: &str,
first_line: u32,
)
pub fn append( &mut self, text: &mut String, body: &str, file: &str, first_line: u32, )
Append body, which starts on line first_line of file, to text,
separated from what text already holds by a newline, and record where
it landed.
Sourcepub fn append_mapped(&mut self, text: &mut String, body: &str, map: &SourceMap)
pub fn append_mapped(&mut self, text: &mut String, body: &str, map: &SourceMap)
Append the text body that map describes to text, the way
Self::append appends one piece, keeping each of its pieces.
Sourcepub fn name_unnamed(&mut self, file: &str)
pub fn name_unnamed(&mut self, file: &str)
Give every piece recorded without a file the name file.
Sourcepub fn place_in(&mut self, text: &str, written: &str)
pub fn place_in(&mut self, text: &str, written: &str)
Count each piece’s first line in written, the markup as the author
wrote it, where the piece’s text is found there as the body of an
element. text is the concatenation this map describes.
A parse sees markup with its <include> files spliced in, which shifts
every line after an include; the author’s file does not have them. A
piece whose text the file does not hold (one an include brought in)
keeps the line it was recorded with.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SourceMap
impl<'de> Deserialize<'de> for SourceMap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SourceMap
impl StructuralPartialEq for SourceMap
Auto Trait Implementations§
impl Freeze for SourceMap
impl RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl UnsafeUnpin for SourceMap
impl UnwindSafe for SourceMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.