pub struct Names { /* private fields */ }Implementations§
Source§impl Names
impl Names
pub fn new() -> Names
pub fn intern(&mut self, node: NameNode) -> NameId
pub fn str(&mut self, prefix: NameId, s: &str) -> NameId
pub fn component(&self, sym: Symbol) -> &str
pub fn num(&mut self, prefix: NameId, n: u64) -> NameId
Sourcepub fn dotted(&mut self, s: &str) -> NameId
pub fn dotted(&mut self, s: &str) -> NameId
Interns a dotted name such as Nat.succ. Only for well-known names written in source.
pub fn node(&self, id: NameId) -> &NameNode
pub fn prefix(&self, id: NameId) -> NameId
Sourcepub fn is_prefix_of(&self, p: NameId, n: NameId) -> bool
pub fn is_prefix_of(&self, p: NameId, n: NameId) -> bool
true when p is a (non-strict) prefix of n.
Sourcepub fn replace_prefix(&mut self, n: NameId, old: NameId, new: NameId) -> NameId
pub fn replace_prefix(&mut self, n: NameId, old: NameId, new: NameId) -> NameId
Replaces prefix old of n by new (n unchanged when old is not a prefix).
Sourcepub fn append_index_after(&mut self, n: NameId, i: u64) -> NameId
pub fn append_index_after(&mut self, n: NameId, i: u64) -> NameId
Lean’s Name.appendIndexAfter: u ↦ u_1.
pub fn display(&self, id: NameId) -> String
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Names
impl RefUnwindSafe for Names
impl Send for Names
impl Sync for Names
impl Unpin for Names
impl UnsafeUnpin for Names
impl UnwindSafe for Names
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