Struct cov::intern::Interner[][src]

pub struct Interner(_);

The string interner.

See the module documentation for detail.

Methods

impl Interner
[src]

Creates a new interner.

Inserts a string into the interner. Returns a Symbol which can be use to extract the original string.

Important traits for Iter<'a>

Iterates the content of the interner.

Examples

use cov::Interner;

let mut interner = Interner::new();
let s1 = interner.intern("one");
let s2 = interner.intern("two");
let s3 = interner.intern("three");

let iter_res = interner.iter().collect::<Vec<_>>();
assert_eq!(iter_res, vec![
    (s1, "one"),
    (s2, "two"),
    (s3, "three"),
]);

Trait Implementations

impl Debug for Interner
[src]

Formats the value using the given formatter. Read more

impl Default for Interner
[src]

Returns the "default value" for a type. Read more

impl Index<Symbol> for Interner
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

Auto Trait Implementations

impl Send for Interner

impl Sync for Interner