pub struct SharedParse {
pub syntax: SourceFile,
pub source_text: Arc<str>,
pub source_map: SourceMap,
pub source_encoding: SourceEncoding,
pub decode_errors: Vec<DecodeDiagnostic>,
pub lex_errors: Vec<LexDiagnostic>,
pub errors: Vec<ParseError>,
}Expand description
Shared full-parse result backed by Arc<str>.
Use this when the decoded source text needs to be shared across multiple downstream consumers without cloning the full string.
Fields§
§syntax: SourceFile§source_text: Arc<str>§source_map: SourceMap§source_encoding: SourceEncoding§decode_errors: Vec<DecodeDiagnostic>§lex_errors: Vec<LexDiagnostic>§errors: Vec<ParseError>Implementations§
pub fn source_view(&self) -> SourceView<'_>
pub fn source_range(&self, range: TextRange) -> Range<usize>
pub fn source_slice(&self, range: TextRange) -> &str
pub fn display_slice(&self, range: TextRange) -> &str
pub fn string_literal_contents(&self, range: TextRange) -> Option<&str>
Trait Implementations§
Source§fn clone(&self) -> SharedParse
fn clone(&self) -> SharedParse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§fn from(value: SharedParse) -> Self
fn from(value: SharedParse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more