Struct swc_common::source_map::hygiene::Mark
source · [−]pub struct Mark(_);
Expand description
A mark is a unique id associated with a macro expansion.
Implementations
sourceimpl Mark
impl Mark
pub fn fresh(parent: Mark) -> Self
sourcepub const fn root() -> Self
pub const fn root() -> Self
The mark of the theoretical expansion that generates freshly parsed, unexpanded AST.
pub fn as_u32(self) -> u32
pub fn from_u32(raw: u32) -> Mark
pub fn parent(self) -> Mark
pub fn is_builtin(self) -> bool
pub fn set_is_builtin(self, is_builtin: bool)
pub fn is_descendant_of(self, ancestor: Mark) -> bool
sourcepub fn least_ancestor(a: Mark, b: Mark) -> Mark
pub fn least_ancestor(a: Mark, b: Mark) -> Mark
Computes a mark such that both input marks are descendants of (or equal to) the returned mark. That is, the following holds:
ⓘ
let la = least_ancestor(a, b);
assert!(a.is_descendant_of(la))
assert!(b.is_descendant_of(la))
Trait Implementations
impl Copy for Mark
impl Eq for Mark
impl StructuralEq for Mark
impl StructuralPartialEq for Mark
Auto Trait Implementations
impl RefUnwindSafe for Mark
impl Send for Mark
impl Sync for Mark
impl Unpin for Mark
impl UnwindSafe for Mark
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more