pub struct SourceSpan {
pub text: String,
pub start: Option<SourceLocation>,
pub end: Option<SourceLocation>,
pub url: String,
pub context: String,
}Expand description
A chunk of a source file.
Fields§
§text: StringThe text covered by the source span. Compilers must guarantee that this is
the text between start.offset and end.offset in the source file
referred to by url.
start: Option<SourceLocation>The location of the first character in this span. Mandatory.
end: Option<SourceLocation>The location of the first character after this span. Optional.
If this is omitted, it indicates that the span is empty and points
immediately before start. In that case, text must be empty.
This must not point to a location before start.
url: StringThe URL of the file to which this span refers.
This may be empty, indicating that the span refers to a
CompileRequest.StringInput file that doesn’t specify a URL.
context: StringAdditional source text surrounding this span.
If this isn’t empty, it must contain text. Furthermore, text must begin
at column start.column of a line in context.
This usually contains the full lines the span begins and ends on if the span itself doesn’t cover the full lines.
Trait Implementations§
Source§impl Clone for SourceSpan
impl Clone for SourceSpan
Source§fn clone(&self) -> SourceSpan
fn clone(&self) -> SourceSpan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SourceSpan
impl Debug for SourceSpan
Source§impl Default for SourceSpan
impl Default for SourceSpan
Source§impl Message for SourceSpan
impl Message for SourceSpan
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.