pub struct Unit {
pub kind: UnitKind,
pub name: Option<String>,
pub token_start: usize,
pub token_end: usize,
pub span: SourceSpan,
}Expand description
A coarse code unit: a token range plus its source span.
Fields§
§kind: UnitKindThe unit’s kind.
name: Option<String>The unit’s name, when the frontend can recover one.
token_start: usizeIndex of the unit’s first token in the stream.
token_end: usizeIndex one past the unit’s last token in the stream.
span: SourceSpanSource span covering the unit, for reporting.
Trait Implementations§
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.