1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Matching is not limited to character strings. I'm trying to make a game AI.  

//! 文字列に限らないマッチングです。 ゲームAIを作ろうとしています。  


// Publish:

//

// (1) `cargo test`

// (2) `cargo run --example example`

// (3) Open auto-generated log file. I check it.

// (4) Remove the log file.

// (5) Update `README.md`.

// (6) Version up on Cargo.toml.

// (7) `cargo doc --open`

// (8) Comit to Git-hub.

// (9) `cargo publish --dry-run`

// (10) `cargo publish`


pub mod actual_items;
pub mod actual_items_builder;
pub mod any;
pub mod any_builder;
pub mod expected_items;
pub mod expected_items_builder;
pub mod machine;

pub struct Machine {
    index: usize,
}

pub struct ActualItemsBuilder<T> {
    items: Vec<T>,
}

pub struct ActualItems<T> {
    items: Vec<T>,
}

pub struct ExpectedItemsBuilder<T> {
    items: Vec<Expected<T>>,
}

pub struct ExpectedItems<T> {
    items: Vec<Expected<T>>,
}

/// Expected item.  

#[derive(Clone)]
pub enum Expected<T> {
    Exact(T),
    Any(Any<T>),
}

pub struct AnyBuilder<T> {
    items: Vec<T>,
}

#[derive(Clone)]
pub struct Any<T> {
    items: Vec<T>,
}