pub fn with_lower_upper<D, L, U>(dir: D, lower: L, upper: U) -> Range<T>
    where
        RangeDir: From<D>,
        T: From<L> + From<U>,
    {
        let dir = dir.into();
        let (left, right) = match dir {
            RangeDir::To => (lower.into(), upper.into()),
            RangeDir::Downto => (upper.into(), lower.into()),
        };
        Range {
            dir: dir,
            left: left,
            right: right,
        }
    }
/// Create a range from lower and upper bounds.
///
/// # Example
///
/// ```
/// use moore_vhdl::ty2::{IntegerRange, RangeDir};
///
/// let a = IntegerRange::with_lower_upper(RangeDir::To, 0, 42);
/// let b = IntegerRange::with_lower_upper(RangeDir::Downto, 0, 42);
///
/// assert_eq!(format!("{}", a), "0 to 42");
/// assert_eq!(format!("{}", b), "42 downto 0");
/// ```
Create a range from lower and upper bounds.
Create a range from lower and upper bounds .
pub fn with_lower_upper<D, L, U>(dir: D, lower: L, upper: U) -> Range<T>
    where
        RangeDir: From<D>,
        T: From<L> + From<U>,
    {
        let dir = dir.into();
        let (left, right) = match dir {
            RangeDir::To => (lower.into(), upper.into()),
            RangeDir::Downto => (upper.into(), lower.into()),
        };
        Range {
            dir: dir,
            left: left,
            right: right,
        }
    }
pub fn with_lower_upper < D , L , U > ( dir : D , lower : L , upper : U ) -> Range < T > where RangeDir : From < D > , T : From < L > + From < U > , { let dir = dir . into ( ) ; let ( left , right ) = match dir { RangeDir :: To => ( lower . into ( ) , upper . into ( ) ) , RangeDir :: Downto => ( upper . into ( ) , lower . into ( ) ) , } ; Range { dir : dir , left : left , right : right , } }
Create a range from lower and upper bounds.
Create a range from lower and upper bounds .
dir
D
lower
L
upper
U
dir
D
lower
L
upper
U
example
```
use moore_vhdl::ty2::{IntegerRange, RangeDir}.

let a = IntegerRange::with_lower_upper(RangeDir::To, 0, 42);
let b = IntegerRange::with_lower_upper(RangeDir::Downto, 0, 42).


` ` ` use moore_vhdl :: ty2 :: { IntegerRange RangeDir } . let a = IntegerRange :: with_lower_upper ( RangeDir :: To 0 42 ) ; let b = IntegerRange :: with_lower_upper ( RangeDir :: Downto 0 42 ) .