3

Indeed, I don't understand this statement A type that can be used in runtime structures in docs: https://paritytech.github.io/substrate/master/sp_runtime/traits/trait.Member.html

I noticed that some associated types in Config trait (like Index, BlockNumber, Hash,...) have defined Member trait, but the rest are not.

I have some questions:

  1. When do we use Member trait?
  2. What is the purpose of Member trait?

1 Answer 1

2

This trait seem to have been added years ago and hasn't had much change ever since. I think the primary purpose is to simply be the super-trait number of other sub-traits and be used for any type that needs to be bounded by all the sub-traits.

You can and should use Member in any place where the set of sub-traits is what you already wanted to bound something by.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.