Skip to content

Commit e4e7c9f

Browse files
authored
Document encode_bound, decode_bound and mel_bound (#374)
* Document encode_bound, decode_bound and mel_bound * Rewrite docs
1 parent 47d98a1 commit e4e7c9f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@
235235
//! - `codec(index = 0)`: Needs to be placed above an enum variant to make the variant use the given
236236
//! index when encoded. By default the index is determined by counting from `0` beginning wth the
237237
//! first variant.
238+
//! - `codec(encode_bound)`, `codec(decode_bound)` and `codec(mel_bound)`: All 3 attributes take
239+
//! in a `where` clause for the `Encode`, `Decode` and `MaxEncodedLen` trait implementation for
240+
//! the annotated type respectively.
241+
//! - `codec(encode_bound(skip_type_params))`, `codec(decode_bound(skip_type_params))` and
242+
//! `codec(mel_bound(skip_type_params))`: All 3 sub-attributes take in types as arguments to skip
243+
//! trait derivation of the corresponding trait, e.g. T in
244+
//! `codec(encode_bound(skip_type_params(T)))` will not contain a `Encode` trait bound while
245+
//! `Encode` is being derived for the annotated type.
238246
239247
#![warn(missing_docs)]
240248
#![cfg_attr(not(feature = "std"), no_std)]

0 commit comments

Comments
 (0)