Type Definition heapless::FnvIndexSet[][src]

type FnvIndexSet<T, N> = IndexSet<T, N, BuildHasherDefault<FnvHasher>>;

A heapless::IndexSet using the default FNV hasher. A list of all Methods and Traits available for FnvIndexSet can be found in the heapless::IndexSet documentation.

Examples

use heapless::FnvIndexSet;
use heapless::consts::*;

// A hash set with a capacity of 16 elements allocated on the stack
let mut books = FnvIndexSet::<_, U16>::new();

// Add some books.
books.insert("A Dance With Dragons").unwrap();
books.insert("To Kill a Mockingbird").unwrap();
books.insert("The Odyssey").unwrap();
books.insert("The Great Gatsby").unwrap();

// Check for a specific one.
if !books.contains("The Winds of Winter") {
    println!("We have {} books, but The Winds of Winter ain't one.",
             books.len());
}

// Remove a book.
books.remove("The Odyssey");

// Iterate over everything.
for book in &books {
    println!("{}", book);
}