Struct moore_vhdl::ty2::EnumBasetype
source · [−]pub struct EnumBasetype { /* private fields */ }
Expand description
An enumeration base type.
Implementations
sourceimpl EnumBasetype
impl EnumBasetype
sourcepub fn new<I: IntoIterator<Item = EnumVariant>>(lits: I) -> EnumBasetype
pub fn new<I: IntoIterator<Item = EnumVariant>>(lits: I) -> EnumBasetype
Create a new enumeration type.
Example
use moore_vhdl::ty2::{Type, EnumBasetype};
let ty = EnumBasetype::new(vec![
"first".into(),
"second".into(),
'0'.into(),
'1'.into(),
]);
assert_eq!(format!("{}", ty), "(first, second, '0', '1')");
Trait Implementations
sourceimpl<'a, 't> Alloc<'a, 'a, EnumBasetype> for TypeArena<'t> where
't: 'a,
impl<'a, 't> Alloc<'a, 'a, EnumBasetype> for TypeArena<'t> where
't: 'a,
sourcefn alloc(&'a self, value: EnumBasetype) -> &'a mut EnumBasetype
fn alloc(&'a self, value: EnumBasetype) -> &'a mut EnumBasetype
Allocate a value of type T
.
sourceimpl Clone for EnumBasetype
impl Clone for EnumBasetype
sourcefn clone(&self) -> EnumBasetype
fn clone(&self) -> EnumBasetype
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for EnumBasetype
impl Debug for EnumBasetype
sourceimpl Display for EnumBasetype
impl Display for EnumBasetype
sourceimpl EnumType for EnumBasetype
impl EnumType for EnumBasetype
sourcefn variants(&self) -> &[EnumVariant]
fn variants(&self) -> &[EnumVariant]
The variants of this enumeration type.
sourcefn as_basetype(&self) -> Option<&EnumBasetype>
fn as_basetype(&self) -> Option<&EnumBasetype>
Returns Some
if self is an EnumBasetype
, None
otherwise.
sourcefn resolution_func(&self) -> Option<usize>
fn resolution_func(&self) -> Option<usize>
The resolution function associated with this type.
sourcefn as_subtype(&self) -> Option<&EnumSubtype<'_>>
fn as_subtype(&self) -> Option<&EnumSubtype<'_>>
Returns Some
if self is an EnumSubtype
, None
otherwise.
sourcefn unwrap_basetype(&self) -> &EnumBasetype
fn unwrap_basetype(&self) -> &EnumBasetype
Returns an &EnumBasetype
or panics if the type is not a basetype.
sourcefn unwrap_subtype(&self) -> &EnumSubtype<'_>
fn unwrap_subtype(&self) -> &EnumSubtype<'_>
Returns an &EnumSubtype
or panics if the type is not a subtype.
sourceimpl PartialEq<EnumBasetype> for EnumBasetype
impl PartialEq<EnumBasetype> for EnumBasetype
sourcefn eq(&self, other: &EnumBasetype) -> bool
fn eq(&self, other: &EnumBasetype) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &EnumBasetype) -> bool
fn ne(&self, other: &EnumBasetype) -> bool
This method tests for !=
.
sourceimpl Type for EnumBasetype
impl Type for EnumBasetype
sourcefn is_discrete(&self) -> bool
fn is_discrete(&self) -> bool
Check if this is a discrete type. Read more
sourcefn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Check if this is a numeric type. Read more
sourcefn is_composite(&self) -> bool
fn is_composite(&self) -> bool
Check if this is a composite type. Read more
sourcefn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
fn into_owned<'a>(self) -> OwnedType<'a> where
Self: 'a,
Convert into an owned type.
sourcefn is_implicitly_castable(&self, _into: &dyn Type) -> bool
fn is_implicitly_castable(&self, _into: &dyn Type) -> bool
Check if the type can be implicitly cast to another.
impl Eq for EnumBasetype
impl StructuralEq for EnumBasetype
impl StructuralPartialEq for EnumBasetype
Auto Trait Implementations
impl RefUnwindSafe for EnumBasetype
impl Send for EnumBasetype
impl Sync for EnumBasetype
impl Unpin for EnumBasetype
impl UnwindSafe for EnumBasetype
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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more