[][src]Enum moore_vhdl::konst2::AnyConst

pub enum AnyConst<'r, 't: 'r> {
    Integer(&'r IntegerConst<'t>),
    Floating(&'r FloatingConst<'t>),
}

A borrowed constant.

Variants

Integer(&'r IntegerConst<'t>)
Floating(&'r FloatingConst<'t>)

Implementations

impl<'r, 't> AnyConst<'r, 't>[src]

pub fn as_const(self) -> &'r dyn Const2<'t>[src]

Perform type erasure.

pub fn as_integer(self) -> Option<&'r IntegerConst<'t>>[src]

Returns Some(k) if the constant is Integer(k), None otherwise.

pub fn as_floating(self) -> Option<&'r FloatingConst<'t>>[src]

Returns Some(k) if the constant is Floating(k), None otherwise.

pub fn unwrap_integer(self) -> &'r IntegerConst<'t>[src]

Returns an &IntegerConst or panics if the constant is not Integer.

pub fn unwrap_floating(self) -> &'r FloatingConst<'t>[src]

Returns a &FloatingConst or panics if the constant is not Floating.

Trait Implementations

impl<'r, 't: 'r> Clone for AnyConst<'r, 't>[src]

impl<'r, 't: 'r> Copy for AnyConst<'r, 't>[src]

impl<'r, 't> Debug for AnyConst<'r, 't>[src]

impl<'r, 't> Display for AnyConst<'r, 't>[src]

impl<'r, 't: 'r> Eq for AnyConst<'r, 't>[src]

impl<'r, 't, T: Const2<'t>> From<&'r T> for AnyConst<'r, 't>[src]

impl<'r, 't: 'r> PartialEq<AnyConst<'r, 't>> for AnyConst<'r, 't>[src]

impl<'r, 't: 'r> StructuralEq for AnyConst<'r, 't>[src]

impl<'r, 't: 'r> StructuralPartialEq for AnyConst<'r, 't>[src]

Auto Trait Implementations

impl<'r, 't> !RefUnwindSafe for AnyConst<'r, 't>

impl<'r, 't> !Send for AnyConst<'r, 't>

impl<'r, 't> !Sync for AnyConst<'r, 't>

impl<'r, 't> Unpin for AnyConst<'r, 't> where
    't: 'r, 

impl<'r, 't> !UnwindSafe for AnyConst<'r, 't>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.