Skip to content

Commit

Permalink
docs: Add attrs forwarding to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikthebird committed Jul 10, 2024
1 parent 306f8d5 commit bded53e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sylvia-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ pub(crate) fn crate_module() -> Path {
/// }
/// # fn main() {}
/// ```
///
/// ### `sv::msg_attr(msg_type, {...})`
///
/// This attribute can be used for the whole `trait Interface {}` block and
/// for the following message types: `exec`, `query`, `sudo` and `reply`.
/// The `{...}` part will be forwarded as an attribute `#[{...}]` to the
/// given message type (enum or struct).
///
/// ### `sv::attr({...})`
///
/// Forwards variant's attribute to the specific enum's field in the
/// generated message type. It can be used along with `sv::msg(...)`
/// and only for message types variants that resolves in an enum field,
/// i.e. `exec`, `query` and `sudo`.
///
#[proc_macro_error]
#[proc_macro_attribute]
Expand Down Expand Up @@ -600,6 +614,20 @@ fn interface_impl(_attr: TokenStream2, item: TokenStream2) -> TokenStream2 {
/// # fn main() {}
/// ```
///
/// ### `sv::msg_attr(msg_type, {...})`
///
/// This attribute can be used for the whole `impl Contract` block and
/// for every message type: `exec`, `query`, `sudo`, `instantiate`,
/// `migrate` and `reply`. The `{...}` part will be forwarded as an
/// attribute `#[{...}]` to the given message type (enum or struct).
///
/// ### `sv::attr({...})`
///
/// Forwards variant's attribute to the specific enum's field in the
/// generated message type. It can be used along with `sv::msg(...)`
/// and only for message types variants that resolves in an enum field,
/// i.e. `exec`, `query` and `sudo`.
///
///
#[proc_macro_error]
#[proc_macro_attribute]
Expand Down

0 comments on commit bded53e

Please sign in to comment.