pub struct CapturedInput { /* private fields */ }Expand description
One captured declared input: the top-level token trees, and how many span handles the producer issued.
Implementations§
Source§impl CapturedInput
impl CapturedInput
Sourcepub fn cursor(&self) -> CaptureCursor<'_>
pub fn cursor(&self) -> CaptureCursor<'_>
Open a mechanical read cursor over the top-level captured sequence.
Source§impl CapturedInput
impl CapturedInput
Sourcepub fn fragment(&self) -> CapturedFragment<'_>
pub fn fragment(&self) -> CapturedFragment<'_>
Borrow this complete captured input as one exact fragment.
Source§impl CapturedInput
impl CapturedInput
Read this declared item boundary into a source-coupled structural lens for one supported item family.
The complete token reading remains available through AuthoredItem::preserved.
The lens identifies only the outer item envelope and leaves full Rust legality to Rustc.
§Errors
Returns a typed refusal where the boundary is empty, has no recognized item family or required name, or does not end as one complete item boundary.
Source§impl CapturedInput
impl CapturedInput
Sourcepub fn trees(&self) -> &[CapturedTokenTree]
pub fn trees(&self) -> &[CapturedTokenTree]
The top-level trees, in the order they were written.
Sourcepub const fn issued(&self) -> usize
pub const fn issued(&self) -> usize
How many span handles the producer issued; a handle at or past this index names no token.
Sourcepub fn canonical_bytes(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes(&self) -> Vec<u8> ⓘ
The canonical bytes of this capture — what an identity over the declared input is derived from.
Deterministic and independent of span handles, so two captures of one declaration from different producers encode identically.
Trait Implementations§
Source§impl Clone for CapturedInput
impl Clone for CapturedInput
Source§fn clone(&self) -> CapturedInput
fn clone(&self) -> CapturedInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more