[−][src]Trait moore_vhdl::konst2::Const2
An interface for dealing with constants.
This is the main trait which all constant values implement. Its purpose is to provide a convenient interface for inspecting and manipulating values. Dedicated structs for the specific types (e.g. integers, arrays, etc.) are expected to be allocated/internalized into an arena for ease of use.
Required methods
fn ty(&self) -> &'t dyn Type
Return the type of the constant.
fn into_owned(self) -> OwnedConst<'t>
Convert into an owned constant.
fn to_owned(&self) -> OwnedConst<'t>
Clone this constant.
fn as_any<'r>(&'r self) -> AnyConst<'r, 't>
Converts from &Const2
to AnyConst
.
fn cast(&self, ty: &'t dyn Type) -> Result<Cow<dyn Const2<'t> + 't>, ConstError>
Cast the constant to a different type.
Trait Implementations
impl<'t> AllocOwned<'t, 't, dyn Const2<'t> + 't> for ConstArena<'t>
[src]
fn alloc_owned(&'t self, value: OwnedConst<'t>) -> &'t dyn Const2<'t>
[src]
fn maybe_alloc(&'a self, value: Cow<'t, T>) -> &'t T
[src]
fn force_alloc(&'a self, value: Cow<T>) -> &'t T
[src]
impl<'t> ToOwned for dyn Const2<'t> + 't
[src]
type Owned = OwnedConst<'t>
The resulting type after obtaining ownership.