pub struct UniqueIdents<'a>(/* private fields */);Expand description
A scope for generating unique, valid Rust identifiers.
Implementations§
Source§impl<'a> UniqueIdents<'a>
impl<'a> UniqueIdents<'a>
Sourcepub fn new(arena: &'a Arena) -> Self
pub fn new(arena: &'a Arena) -> Self
Creates a new identifier scope that’s backed by the given arena.
Sourcepub fn with_reserved(arena: &'a Arena, reserved: &[&str]) -> Self
pub fn with_reserved(arena: &'a Arena, reserved: &[&str]) -> Self
Creates a new identifier scope that’s backed by the given arena, with additional pre-reserved names.
Sourcepub fn claim(&mut self, name: &str) -> UniqueIdent<'a>
pub fn claim(&mut self, name: &str) -> UniqueIdent<'a>
Uniquifies an identifier fragment.
Sourcepub fn adopt(&mut self, ident: UniqueIdent<'a>) -> UniqueIdent<'a>
pub fn adopt(&mut self, ident: UniqueIdent<'a>) -> UniqueIdent<'a>
Uniquifies an identifier from another scope.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for UniqueIdents<'a>
impl<'a> !RefUnwindSafe for UniqueIdents<'a>
impl<'a> !Send for UniqueIdents<'a>
impl<'a> !Sync for UniqueIdents<'a>
impl<'a> Unpin for UniqueIdents<'a>
impl<'a> UnsafeUnpin for UniqueIdents<'a>
impl<'a> !UnwindSafe for UniqueIdents<'a>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more