neo_solidity/
docs.rs

1//! Documentation Generator
2//!
3//! Generates API documentation from source code.
4
5/// Documentation item
6#[derive(Debug, Clone)]
7pub struct DocItem {
8    pub name: String,
9    pub kind: DocKind,
10    pub description: String,
11    pub params: Vec<DocParam>,
12    pub returns: Option<String>,
13}
14
15/// Documentation kind
16#[derive(Debug, Clone, Copy)]
17pub enum DocKind {
18    Contract,
19    Function,
20    Event,
21    Modifier,
22    Variable,
23}
24
25/// Parameter documentation
26#[derive(Debug, Clone)]
27pub struct DocParam {
28    pub name: String,
29    pub type_name: String,
30    pub description: String,
31}
32
33impl DocItem {
34    pub fn new(name: impl Into<String>, kind: DocKind) -> Self {
35        Self {
36            name: name.into(),
37            kind,
38            description: String::new(),
39            params: Vec::new(),
40            returns: None,
41        }
42    }
43}