pub struct Names { /* private fields */ }Expand description
A tree of names.
Implementations§
Source§impl Names
impl Names
Sourcepub fn insert<I>(&mut self, iter: I) -> bool
pub fn insert<I>(&mut self, iter: I) -> bool
Insert the given item as an import.
§Examples
use runestick::Names;
let mut names = Names::new();
assert!(!names.contains(&["test"]));
assert!(!names.insert(&["test"]));
assert!(names.contains(&["test"]));
assert!(names.insert(&["test"]));Sourcepub fn contains<I>(&self, iter: I) -> bool
pub fn contains<I>(&self, iter: I) -> bool
Test if the given import exists.
§Examples
use runestick::Names;
let mut names = Names::new();
assert!(!names.contains(&["test"]));
assert!(!names.insert(&["test"]));
assert!(names.contains(&["test"]));
assert!(names.insert(&["test"]));Sourcepub fn contains_prefix<I>(&self, iter: I) -> bool
pub fn contains_prefix<I>(&self, iter: I) -> bool
Test if we contain the given prefix.
Sourcepub fn iter_components<'a, I>(
&'a self,
iter: I,
) -> impl Iterator<Item = ComponentRef<'a>> + 'a
pub fn iter_components<'a, I>( &'a self, iter: I, ) -> impl Iterator<Item = ComponentRef<'a>> + 'a
Iterate over all known components immediately under the specified iter
path.
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 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