pub struct TypeRegistry { /* private fields */ }Expand description
Type registry: maps type names to TypeDef and provides
constructor-namespace lookup.
The constructor namespace is separate from the type namespace: a
single lexeme can name both a type (Position — the n-variant
union) and a constructor (Position — the sole constructor of that
union). lookup_ctor walks the constructor
side; get_type walks the type side.
Implementations§
Source§impl TypeRegistry
impl TypeRegistry
Sourcepub fn lookup_ctor(
&self,
ctor: &ConstructorName,
) -> Option<(&TypeDef, &UnionMemberDef)>
pub fn lookup_ctor( &self, ctor: &ConstructorName, ) -> Option<(&TypeDef, &UnionMemberDef)>
Look up the union that owns a constructor name, plus the
constructor’s payload fields. Returns None if the name is not
a registered constructor.
Trait Implementations§
Source§impl Clone for TypeRegistry
impl Clone for TypeRegistry
Source§fn clone(&self) -> TypeRegistry
fn clone(&self) -> TypeRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TypeRegistry
impl RefUnwindSafe for TypeRegistry
impl Send for TypeRegistry
impl Sync for TypeRegistry
impl Unpin for TypeRegistry
impl UnsafeUnpin for TypeRegistry
impl UnwindSafe for TypeRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more