Add some doc comments.
diff --git a/src/derive.rs b/src/derive.rs
index 20b710b..306c352 100644
--- a/src/derive.rs
+++ b/src/derive.rs
@@ -1,17 +1,31 @@
use super::*;
+/// Struct or enum sent to a `proc_macro_derive` macro.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct DeriveInput {
+ /// Name of the struct or enum.
pub ident: Ident,
+
+ /// Visibility of the struct or enum.
pub vis: Visibility,
+
+ /// Attributes tagged on the whole struct or enum.
pub attrs: Vec<Attribute>,
+
+ /// Generics required to complete the definition.
pub generics: Generics,
+
+ /// Data within the struct or enum.
pub body: Body,
}
+/// Body of a derived struct or enum.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum Body {
+ /// It's an enum.
Enum(Vec<Variant>),
+
+ /// It's a struct.
Struct(VariantData),
}