[−][src]Type Definition moore_vhdl::ty2::FloatingSubtype
type FloatingSubtype<'t> = ScalarSubtype<'t, dyn FloatingType, f64>;
A subtype of an real type.
Methods
impl<'t> FloatingSubtype<'t>
[src]
pub fn new(
mark: &'t TypeMark<'t>,
range: Range<f64>
) -> Option<FloatingSubtype<'t>>
[src]
mark: &'t TypeMark<'t>,
range: Range<f64>
) -> Option<FloatingSubtype<'t>>
Create a new real subtype.
Returns Some(...)
if range
is a subrange of the real, or None
otherwise.
Example
use moore_vhdl::ty2::{Type, TypeMark, FloatingBasetype, FloatingSubtype, Range}; use moore_vhdl::common::name::get_name_table; let ty = FloatingBasetype::new(Range::ascending(0.0, 1.0)); let tm = TypeMark::new( get_name_table().intern("UNIT", false), &ty, ); let a = FloatingSubtype::new(&tm, Range::ascending(0.0, 0.5)).unwrap(); let b = FloatingSubtype::new(&tm, Range::descending(0.5, 0.0)).unwrap(); assert_eq!(format!("{}", a), "UNIT range 0 to 0.5"); assert_eq!(format!("{}", b), "UNIT range 0.5 downto 0");
Trait Implementations
impl<'t> Type for FloatingSubtype<'t>
[src]
fn is_scalar(&self) -> bool
[src]
fn is_discrete(&self) -> bool
[src]
fn is_numeric(&self) -> bool
[src]
fn is_composite(&self) -> bool
[src]
fn as_any(&self) -> AnyType
[src]
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,
fn to_owned<'a>(&self) -> OwnedType<'a> where
Self: 'a,
[src]
Self: 'a,