pub struct ValueSignature {
pub span: NodeSpan,
pub context: Vec<Constraint>,
pub tpe: Type,
}Expand description
What an Interface publishes of a value: where it was declared, its type, and the
constraints its annotation wrote in front of that type.
One struct rather than a map per field, so an entry cannot have a type and lack the
context it was written with: an importer’s call to a constrained function is checked
against this entry, and an empty context here means the function
is unconstrained.
Fields§
§span: NodeSpanWhere the declaration (annotation and body together) was written —
Value::span — so a diagnostic about a name found in an interface can point at
the declaration, not just name it.
context: Vec<Constraint>The annotation’s resolved constraints, in the order written.
tpe: TypeImplementations§
Source§impl ValueSignature
impl ValueSignature
Sourcepub fn unconstrained(span: NodeSpan, tpe: Type) -> ValueSignature
pub fn unconstrained(span: NodeSpan, tpe: Type) -> ValueSignature
The signature of a value declared at span with the type tpe and no
constraint.
Trait Implementations§
Source§impl Clone for ValueSignature
impl Clone for ValueSignature
Source§fn clone(&self) -> ValueSignature
fn clone(&self) -> ValueSignature
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 moreSource§impl Debug for ValueSignature
impl Debug for ValueSignature
Source§impl PartialEq for ValueSignature
impl PartialEq for ValueSignature
impl StructuralPartialEq for ValueSignature
Auto Trait Implementations§
impl Freeze for ValueSignature
impl RefUnwindSafe for ValueSignature
impl Send for ValueSignature
impl Sync for ValueSignature
impl Unpin for ValueSignature
impl UnsafeUnpin for ValueSignature
impl UnwindSafe for ValueSignature
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