/// Create a new integer subtype.
///
/// Returns `Some(...)` if `range` is a subrange of the integer, or `None`
/// otherwise.
///
/// # Example
///
/// ```
/// use moore_vhdl::ty2::{Type, TypeMark, IntegerBasetype, IntegerSubtype, Range};
/// use moore_common::name::get_name_table;
///
/// let ty = IntegerBasetype::new(Range::ascending(0usize, 255usize));
/// let tm = TypeMark::new(
///     get_name_table().intern("BYTE", false),
///     &ty,
/// );
/// let a = IntegerSubtype::new(&tm, Range::ascending(0usize, 15usize)).unwrap();
/// let b = IntegerSubtype::new(&tm, Range::descending(15usize, 0usize)).unwrap();
///
/// assert_eq!(format!("{}", a), "BYTE range 0 to 15");
/// assert_eq!(format!("{}", b), "BYTE range 15 downto 0");
/// ```
Create a new integer subtype.
Create a new integer subtype .
pub fn new(mark: &'t TypeMark<'t>, range: Range<BigInt>) -> Option<IntegerSubtype<'t>> {
        let base = mark.as_any().unwrap_integer();
        let base_range = base.range()?;
        if base_range.has_subrange(&range) {
            Some(IntegerSubtype {
                resfn: base.resolution_func(),
                mark: mark,
                base: base,
                con: range,
            })
        } else {
            None
        }
    }
pub fn new ( mark : & ' t TypeMark < ' t > , range : Range < BigInt > ) -> Option < IntegerSubtype < ' t > > { let base = mark . as_any ( ) . unwrap_integer ( ) ; let base_range = base . range ( ) ? ; if base_range . has_subrange ( & range ) { Some ( IntegerSubtype { resfn : base . resolution_func ( ) , mark : mark , base : base , con : range , } ) } else { None } }
Create a new integer subtype.
Create a new integer subtype .
mark
&'t TypeMark<'t>
range
Range<BigInt>
example
```
use moore_vhdl::ty2::{Type, TypeMark, IntegerBasetype, IntegerSubtype, Range};
use moore_common::name::get_name_table.

let ty = IntegerBasetype::new(Range::ascending(0usize, 255usize));
let tm = TypeMark::new(
get_name_table().intern("BYTE", false),
&ty,
);
let a = IntegerSubtype::new(&tm, Range::ascending(0usize, 15usize)).unwrap();
let b = IntegerSubtype::new(&tm, Range::descending(15usize, 0usize)).unwrap().


` ` ` use moore_vhdl :: ty2 :: { Type TypeMark IntegerBasetype IntegerSubtype Range } ; use moore_common :: name :: get_name_table . let ty = IntegerBasetype :: new ( Range :: ascending ( 0usize 255usize )) ; let tm = TypeMark :: new ( get_name_table () . intern ( " BYTE " false ) &ty ) ; let a = IntegerSubtype :: new ( &tm Range :: ascending ( 0usize 15usize )) . unwrap () ; let b = IntegerSubtype :: new ( &tm Range :: descending ( 15usize 0usize )) . unwrap () .