pub struct Scalar {
pub module: &'static str,
pub name: &'static str,
}Expand description
One scalar type: the module of zelkova-core its declaration lives in, and the name
that declaration writes.
The module is written out with its dots, as a module header writes it, so a
nested module name is spelled the one way everywhere. The package is not a field:
it is CORE_PACKAGE for all five.
Fields§
§module: &'static str§name: &'static strImplementations§
Source§impl Scalar
impl Scalar
Sourcepub fn declares(&self, name: &QualName) -> bool
pub fn declares(&self, name: &QualName) -> bool
Whether name is this scalar’s declaration.
All three parts have to match: Example.Int is not INT, and neither is a
Basics.Int declared by any package but CORE_PACKAGE. An Int that
resolves to nothing never reaches here at all — canonicalization rejects
the name rather than building a type out of it.
Sourcepub fn qual_name(&self) -> QualName
pub fn qual_name(&self) -> QualName
This scalar’s declaration, as the qualified name every phase after canonicalization spells a type with.
The inverse of Scalar::declares, and what a phase reaches for when it needs
to name a scalar rather than recognise one — the typer builds the type of an
if condition out of BOOL this way.
Trait Implementations§
impl Copy for Scalar
impl Eq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl Freeze for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnsafeUnpin for Scalar
impl UnwindSafe for Scalar
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.