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

pub struct Interner(_);

The string interner.

See the module documentation for detail.

Methods

impl Interner
[src]

[src]

Creates a new interner.

[src]

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

[src]

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]

[src]

Formats the value using the given formatter.

impl Default for Interner
[src]

[src]

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

impl Index<Symbol> for Interner
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.