[][src]Struct superfusion::index::IndexList

pub struct IndexList<'a> { /* fields omitted */ }

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]

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?

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?

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

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?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.