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
use typedef::TypeDef;
#[deriving(Copy)]
pub struct ArgCountMismatch {
    pub expected: uint,
    pub specified: uint,
}
#[deriving(Copy)]
pub struct ArgTypeMismatch {
    pub expected_type: TypeDef,
    pub argument_index: uint,
}
impl ArgCountMismatch {
    
    pub fn new(expected: uint, specified: uint) -> ArgCountMismatch {
        ArgCountMismatch {
            expected: expected,
            specified: specified,
        }
    }
}
impl ArgTypeMismatch {
    
    pub fn new(expected_type: TypeDef, argument_index: uint) -> ArgTypeMismatch {
        ArgTypeMismatch {
            expected_type: expected_type,
            argument_index: argument_index,
        }
    }
}
#[deriving(Copy)]
pub enum FactoryErrorKind {
    
    ArgCountMismatch(ArgCountMismatch),
    
    ArgTypeMismatch(ArgTypeMismatch),
}