Skip to main content

Instance

Struct Instance 

Source
pub struct Instance {
    pub signature: InstanceSignature,
    pub derived: bool,
    pub bindings: Vec<Value>,
}
Expand description

An instance declaration of the module under check.

A derived instance is one with the bindings its class’s derivation stands for. Past this point it is read like a written one, bar derived, which says only that its bindings are generated.

Fields§

§signature: InstanceSignature§derived: bool

Whether the body is the word derived. The type checker reads it for one purpose: an error in a binding generated out of a derivation the class’s module rejected is that derivation’s error, reported where it was written.

§bindings: Vec<Value>

One binding per member, each canonicalized as an ordinary value. For a written instance they are in the order written, and a binding that did not canonicalize is left out and its error reported. For a derived one they are the members of the class in the order it declares them, each generated out of the class’s derivation, and every node of one carries the span of the word derived.

Trait Implementations§

Source§

impl Debug for Instance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Instance

Source§

fn eq(&self, other: &Instance) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Instance

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.