pub type FloatingSubtype<'t> = ScalarSubtype<'t, dyn FloatingType, f64>;
Expand description

A subtype of an real type.

Implementations

Create a new real subtype.

Returns Some(...) if range is a subrange of the real, or None otherwise.

Example
use moore_common::name::get_name_table;
use moore_vhdl::ty2::{Type, TypeMark, FloatingBasetype, FloatingSubtype, Range};

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

Formats the value using the given formatter. Read more

Convert to a type.

The range of values this real can assume. Read more

The base type of this real.

Returns Some if self is an FloatingSubtype, None otherwise.

Check if two real types are equal.

The resolution function associated with this type.

Returns Some if self is an FloatingBasetype, None otherwise.

Checks whether this is a universal real type.

Returns an &FloatingBasetype or panics if the type is not a basetype.

Returns an &FloatingSubtype or panics if the type is not a subtype.

Check if this is a scalar type. Read more

Check if this is a discrete type. Read more

Check if this is a numeric type. Read more

Check if this is a composite type. Read more

Converts from &Type to AnyType.

Convert into an owned type.

Clone this type.

Check if two types are equal.

Check if the type can be implicitly cast to another.