Struct superfusion::index::IndexList [−][src]
pub struct IndexList<'a> { /* fields omitted */ }
Expand description
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
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")));
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")));
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.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for IndexList<'a>
impl<'a> UnwindSafe for IndexList<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more