pub struct TextCapture { /* private fields */ }Expand description
One declared input read from text: the captured trees, and the byte offsets that resolve every handle the read issued.
The callable route — a compiler is one producer of captured input, a test is another, and text is the third — so that the reproduction route a diagnostic names is a real road and not a promise. The two seats are visible to the text read alone, and that read establishes the relationship between them: the offsets table resolves exactly the handles the capture beside it issued.
Implementations§
Source§impl TextCapture
impl TextCapture
Sourcepub fn read(source: &str) -> Result<Self, TextReadRefusal>
pub fn read(source: &str) -> Result<Self, TextReadRefusal>
Read one declared Rust token input from source text.
§Errors
Returns TextReadRefusal naming the established cause and source byte.
The source-byte magnitude is checked before tokenization and is independent of every structural capture magnitude.
Sourcepub const fn input(&self) -> &CapturedInput
pub const fn input(&self) -> &CapturedInput
The normalized captured input shared with the compiler-token producer.
Trait Implementations§
Source§impl Clone for TextCapture
impl Clone for TextCapture
Source§fn clone(&self) -> TextCapture
fn clone(&self) -> TextCapture
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more