Struct moore_vhdl::ty2::TypeMark
source · [−]pub struct TypeMark<'t> { /* private fields */ }
Expand description
A type mark.
A TypeMark
associates a name with a type or subtype, but in a different
manner than TypeDecl
and SubtypeDecl
. It is useful as a tracker of how a
type was referred to in the source code. A TypeMark
represents a way of
naming a type that is familiar to the user and can be presented as is in a
diagnostic message.
Examples
use moore_vhdl::ty2::{Type, TypeMark, NullType};
use moore_common::name::get_name_table;
let ta = NullType;
let a = TypeMark::new(
get_name_table().intern("DATA", false),
&ta,
);
assert_eq!(format!("{}", a), "DATA");
Implementations
Trait Implementations
sourceimpl<'t> Type for TypeMark<'t>
impl<'t> Type for TypeMark<'t>
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<'t> Copy for TypeMark<'t>
impl<'t> Eq for TypeMark<'t>
impl<'t> StructuralEq for TypeMark<'t>
impl<'t> StructuralPartialEq for TypeMark<'t>
Auto Trait Implementations
impl<'t> !RefUnwindSafe for TypeMark<'t>
impl<'t> !Send for TypeMark<'t>
impl<'t> !Sync for TypeMark<'t>
impl<'t> Unpin for TypeMark<'t>
impl<'t> !UnwindSafe for TypeMark<'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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more