1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 //! This module contains the xpcom interfaces exposed to rust code.
6 //!
7 //! The items in this module come in a few flavours:
8 //!
9 //! 1. `nsI*`: These are the types for XPCOM interfaces. They should always be
10 //!    passed behind a reference, pointer, or `RefPtr`. They may be coerced to
11 //!    their base interfaces using the `coerce` method.
12 //!
13 //! 2. `nsI*Coerce`: These traits provide the implementation mechanics for the
14 //!    `coerce` method, and can usually be ignored. *These traits are hidden in
15 //!    rustdoc*
16 //!
17 //! 3. `nsI*VTable`: These structs are the vtable definitions for each type.
18 //!    They contain the base interface's vtable, followed by pointers for each
19 //!    of the vtable's methods. If direct access is needed, a `*const nsI*` can
20 //!    be safely transmuted to a `*const nsI*VTable`. *These structs are hidden
21 //!    in rustdoc*
22 //!
23 //! 4. Typedefs used in idl file definitions.
24 
25 // Interfaces defined in .idl files
26 mod idl;
27 pub use self::idl::*;
28 
29 // Other interfaces which are needed to compile
30 mod nonidl;
31 pub use self::nonidl::*;
32