use serde::{Deserialize, Serialize};
/// rustdoc format-version.
-pub const FORMAT_VERSION: u32 = 22;
+pub const FORMAT_VERSION: u32 = 23;
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
/// about the language items in the local crate, as well as info about external items to allow
Constant,
Trait,
TraitAlias,
- Method,
Impl,
Static,
ForeignType,
Trait(Trait),
TraitAlias(TraitAlias),
- Method(Method),
Impl(Impl),
Typedef(Typedef),
Other(String),
}
+/// Represents a function (including methods and other associated functions)
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Function {
pub decl: FnDecl,
pub generics: Generics,
pub header: Header,
-}
-
-#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
-pub struct Method {
- pub decl: FnDecl,
- pub generics: Generics,
- pub header: Header,
pub has_body: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct FnDecl {
+ /// List of argument names and their type.
+ ///
+ /// Note that not all names will be valid identifiers, as some of
+ /// them may be patterns.
pub inputs: Vec<(String, Type)>,
pub output: Option<Type>,
pub c_variadic: bool,