[−][src]Struct runestick::Names
A tree of names.
Implementations
impl<T> Names<T>
[src]
pub fn new() -> Self
[src]
Construct a collection of names.
pub fn insert<I>(&mut self, iter: I, value: T) -> Option<T> where
I: IntoIterator,
I::Item: IntoComponent,
[src]
I: IntoIterator,
I::Item: IntoComponent,
Insert the given item as an import.
Examples
use runestick::Names; let mut names = Names::<()>::new(); assert!(!names.contains(&["test"])); assert!(names.insert(&["test"], ()).is_none()); assert!(names.contains(&["test"])); assert!(names.insert(&["test"], ()).is_some());
pub fn contains<I>(&self, iter: I) -> bool where
I: IntoIterator,
I::Item: IntoComponent,
[src]
I: IntoIterator,
I::Item: IntoComponent,
Test if the given import exists.
Examples
use runestick::Names; let mut names = Names::<()>::new(); assert!(!names.contains(&["test"])); assert!(names.insert(&["test"], ()).is_none()); assert!(names.contains(&["test"])); assert!(names.insert(&["test"], ()).is_some());
pub fn get<I>(&self, iter: I) -> Option<&T> where
I: IntoIterator,
I::Item: IntoComponent,
[src]
I: IntoIterator,
I::Item: IntoComponent,
Get the given entry if it exists.
Examples
use runestick::Names; let mut names = Names::<()>::new(); assert!(names.get(&["test"]).is_none()); assert!(names.insert(&["test"], ()).is_none()); assert!(names.get(&["test"]).is_some()); assert!(names.insert(&["test"], ()).is_some());
pub fn contains_prefix<I>(&self, iter: I) -> bool where
I: IntoIterator,
I::Item: IntoComponent,
[src]
I: IntoIterator,
I::Item: IntoComponent,
Test if we contain the given prefix.
pub fn iter_components<'a, I: 'a>(
&'a self,
iter: I
) -> impl Iterator<Item = ComponentRef<'a>> + 'a where
I: IntoIterator,
I::Item: IntoComponent,
[src]
&'a self,
iter: I
) -> impl Iterator<Item = ComponentRef<'a>> + 'a where
I: IntoIterator,
I::Item: IntoComponent,
Iterate over all known components immediately under the specified iter
path.
Trait Implementations
impl<T: Clone> Clone for Names<T>
[src]
impl<T: Debug> Debug for Names<T>
[src]
impl<T> Default for Names<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Names<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Names<T> where
T: Send,
T: Send,
impl<T> Sync for Names<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Names<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Names<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,