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

//! Generators for file formats that can be derived from the intercom
//! libraries.
//!
//! **Requires the optional `generators` feature**

use model;

/// A common error type for all the generators.
#[derive(Fail, Debug)]
#[non_exhaustive]
pub enum GeneratorError {

    #[fail( display = "{}", _0 )]
    CrateParseError( #[cause] model::ParseError ),

    #[fail( display = "Missing [com_library] attribute" )]
    MissingLibrary,

    #[fail( display = "Type {} requires CLSID", _0 )]
    MissingClsid( String ),

    #[fail( display = "Unsupported type: {}", _0 )]
    UnsupportedType( String ),

    #[fail( display = "Type not found: {}", _0 )]
    TypeNotFound( String ),

    #[fail( display = "{}", _0 )]
    IoError( #[cause] ::std::io::Error ),
}

impl From<::std::io::Error> for GeneratorError {
    fn from( e : ::std::io::Error ) -> GeneratorError {
        GeneratorError::IoError( e )
    }
}

pub mod idl;
pub mod manifest;
pub mod cpp;