[contracts] Add docs generator for the contracts API to the #[define_env] macro (#13032)

* macro to expand traits for host functions documentation

* other way: same Doc trait in seal modules

* added docs for macro, and remove `doc` attribute

* fmt

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* make docs to be generated into re-exported `api_doc` module; fix
unrelated elder docs;

* make it compile without `doc` attr passed to macro

* make alias functions indicated explicitly in docs

* tidy up docs

* refactored a bit

* macro to auto-add doc warning for unstable functions

* invoke macro with no doc generation by default

* addressed review comments

* hide api_doc module behind cfg(doc)

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
Sasha Gryaznov
2023-01-06 01:22:43 +02:00
committed by GitHub
parent 876fccc0e5
commit 628efddce1
5 changed files with 242 additions and 116 deletions
+1 -1
View File
@@ -462,7 +462,7 @@ enum FrameArgs<'a, T: Config, E> {
/// If `None` the contract info needs to be reloaded from storage.
cached_info: Option<ContractInfo<T>>,
/// This frame was created by `seal_delegate_call` and hence uses different code than
/// what is stored at [`Self::dest`]. Its caller ([`Frame::delegated_caller`]) is the
/// what is stored at [`Self::Call::dest`]. Its caller ([`DelegatedCall::caller`]) is the
/// account which called the caller contract
delegated_call: Option<DelegatedCall<T, E>>,
},