Trait moore_vhdl::konst2::Const2 [−][src]
pub trait Const2<'t>: Debug + Display { fn ty(&self) -> &'t dyn Type; fn into_owned(self) -> OwnedConst<'t>; fn to_owned(&self) -> OwnedConst<'t>; fn as_any<'r>(&'r self) -> AnyConst<'r, 't>; fn cast(
&self,
ty: &'t dyn Type
) -> Result<Cow<'_, dyn Const2<'t> + 't>, ConstError>; }
Expand description
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 into_owned(self) -> OwnedConst<'t>
fn into_owned(self) -> OwnedConst<'t>
Convert into an owned constant.
fn to_owned(&self) -> OwnedConst<'t>
fn to_owned(&self) -> OwnedConst<'t>
Clone this constant.
Trait Implementations
type Owned = OwnedConst<'t>
type Owned = OwnedConst<'t>
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more