[−][src]Struct superfusion::index::IndexList
List of Index's references
It use HashSet
internally but provide a bit of abstraction that allow looking up Index base on "path similarity"
Implementations
impl<'a> IndexList<'a>
[src]
pub fn new(indexes: HashSet<&'a Index>) -> Self
[src]
pub fn get_different_pid(&self, index: &Index) -> Option<&Index>
[src]
Get index loosely base on the relative path similar to IndexList::get() but the result index must not contain the same Pid as the given index.
let alpha = Pid::new(0); let beta = Pid::new(1); let foo = Index::new(alpha, "example/path"); let bar = Index::new(beta, "example/path"); let mut list = HashSet::new(); list.insert(&foo); let list = IndexList::new(list); assert_eq!(list.get_different_pid(&foo), None); assert_eq!(list.get_different_pid(&bar), Some(&Index::new(alpha, "example/path")));
pub fn get(&self, index: &Index) -> Option<&Index>
[src]
Get index loosely base on the relative path
let alpha = Pid::new(0); let beta = Pid::new(1); let foo = Index::new(alpha, "example/path"); let bar = Index::new(beta, "example/path"); let mut list = HashSet::new(); list.insert(&foo); let list = IndexList::new(list); assert_eq!(list.get(&bar), Some(&Index::new(alpha, "example/path")));
pub fn get_exact(&self, index: &Index) -> Option<&Index>
[src]
Get index with exactly the same Pid
and Path
This method is really useless since you need to already know the index to run it but it can be useful to check if the index exists, I suppose.
pub fn inner(&self) -> &HashSet<&Index>
[src]
Get access to the internal's HashSet
pub fn iter(&self) -> Iter<&Index>
[src]
Create iterator over Index's reference
Trait Implementations
impl<'a> Clone for IndexList<'a>
[src]
impl<'a> Debug for IndexList<'a>
[src]
impl<'a> Default for IndexList<'a>
[src]
impl<'a> FromIterator<&'a Index> for IndexList<'a>
[src]
fn from_iter<T: IntoIterator<Item = &'a Index>>(iter: T) -> Self
[src]
impl<'a, 'b> IntoIterator for &'a IndexList<'b>
[src]
type Item = &'a &'b Index
The type of the elements being iterated over.
type IntoIter = Iter<'a, &'b Index>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for IndexList<'a>
[src]
type Item = &'a Index
The type of the elements being iterated over.
type IntoIter = IntoIter<&'a Index>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> PartialEq<IndexList<'a>> for IndexList<'a>
[src]
impl<'a> StructuralPartialEq for IndexList<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for IndexList<'a>
impl<'a> Send for IndexList<'a>
impl<'a> Sync for IndexList<'a>
impl<'a> Unpin for IndexList<'a>
impl<'a> UnwindSafe for IndexList<'a>
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<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
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>,