Extract doc-comment on plugin functions.
This commit is contained in:
@@ -282,6 +282,8 @@ pub struct ExportedFn {
|
||||
mut_receiver: bool,
|
||||
params: ExportedFnParams,
|
||||
cfg_attrs: Vec<syn::Attribute>,
|
||||
#[cfg(feature = "metadata")]
|
||||
comment: String,
|
||||
}
|
||||
|
||||
impl Parse for ExportedFn {
|
||||
@@ -404,6 +406,8 @@ impl Parse for ExportedFn {
|
||||
mut_receiver,
|
||||
params: Default::default(),
|
||||
cfg_attrs,
|
||||
#[cfg(feature = "metadata")]
|
||||
comment: Default::default(),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -503,6 +507,16 @@ impl ExportedFn {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "metadata")]
|
||||
pub fn comment(&self) -> &str {
|
||||
&self.comment
|
||||
}
|
||||
|
||||
#[cfg(feature = "metadata")]
|
||||
pub fn set_comment(&mut self, comment: String) {
|
||||
self.comment = comment
|
||||
}
|
||||
|
||||
pub fn set_cfg_attrs(&mut self, cfg_attrs: Vec<syn::Attribute>) {
|
||||
self.cfg_attrs = cfg_attrs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user