Constrained integer as a type


#1

Is it possible to create a type (Struct/Emum) Price which should behave as an u8 but value 0 should be reserved for a special meaning? What are some of the known patterns around this?

What I do currently is

type Price = u8;
const MARKET_ORDER_PRICE: Price = 0;


#2

Perhaps wrap it or write behaviour that is similar to the Option module?