Enum moore_vhdl::konst2::AnyConst
source · [−]pub enum AnyConst<'r, 't: 'r> {
Integer(&'r IntegerConst<'t>),
Floating(&'r FloatingConst<'t>),
}
Expand description
A borrowed constant.
Variants
Integer(&'r IntegerConst<'t>)
Floating(&'r FloatingConst<'t>)
Implementations
sourceimpl<'r, 't> AnyConst<'r, 't>
impl<'r, 't> AnyConst<'r, 't>
sourcepub fn as_integer(self) -> Option<&'r IntegerConst<'t>>
pub fn as_integer(self) -> Option<&'r IntegerConst<'t>>
Returns Some(k)
if the constant is Integer(k)
, None
otherwise.
sourcepub fn as_floating(self) -> Option<&'r FloatingConst<'t>>
pub fn as_floating(self) -> Option<&'r FloatingConst<'t>>
Returns Some(k)
if the constant is Floating(k)
, None
otherwise.
sourcepub fn unwrap_integer(self) -> &'r IntegerConst<'t>
pub fn unwrap_integer(self) -> &'r IntegerConst<'t>
Returns an &IntegerConst
or panics if the constant is not Integer
.
sourcepub fn unwrap_floating(self) -> &'r FloatingConst<'t>
pub fn unwrap_floating(self) -> &'r FloatingConst<'t>
Returns a &FloatingConst
or panics if the constant is not Floating
.
Trait Implementations
impl<'r, 't: 'r> Copy for AnyConst<'r, 't>
impl<'r, 't: 'r> Eq for AnyConst<'r, 't>
impl<'r, 't: 'r> StructuralEq for AnyConst<'r, 't>
impl<'r, 't: 'r> StructuralPartialEq for AnyConst<'r, 't>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more