[][src]Trait gf::datamodel::Eval

pub trait Eval<'a> {
    type Output;
    fn eval<R>(
        &self,
        data: &Data<'a>,
        reader: &mut R
    ) -> Result<Self::Output, ReadDataError>
    where
        R: ReadData
;
fn lint(&self, ty: &'a Ty<'a>) -> Result<(), TyError>;
fn relation_deps(&self) -> Vec<RelationId>; fn relation_deps_as_hash_set(&self) -> HashSet<RelationId> { ... } }

An evaluatable data model entity.

Associated Types

type Output

Evaluation output type.

Loading content...

Required methods

fn eval<R>(
    &self,
    data: &Data<'a>,
    reader: &mut R
) -> Result<Self::Output, ReadDataError> where
    R: ReadData

Evaluate a linted entity.

Errors

  • Undefined behavior if the entity has not been previously linted.

fn lint(&self, ty: &'a Ty<'a>) -> Result<(), TyError>

Lint the entity in the context of its type.

fn relation_deps(&self) -> Vec<RelationId>

Return list of relations that must be parsed before this entity can be evaluated.

The list is not sorted and may contain duplicates.

Loading content...

Provided methods

fn relation_deps_as_hash_set(&self) -> HashSet<RelationId>

Return hash set of relations that must be parsed before this entity can be evaluated.

Loading content...

Implementors

impl<'_> Eval<'_> for Binding[src]

type Output = BitVec

impl<'_> Eval<'_> for EndiannessCtor[src]

type Output = Endianness

impl<'_> Eval<'_> for LocationOrigin[src]

type Output = Range<u64>

impl<'_> Eval<'_> for BoundExpr[src]

type Output = BitVec

impl<'_> Eval<'_> for Location[src]

type Output = u64

impl<'a> Eval<'a> for TyArgCtor<'a>[src]

type Output = TyArgValue<'a>

impl<'a> Eval<'a> for TyInstanceCtor<'a>[src]

type Output = TyInstance<'a>

impl<'a> Eval<'a> for Relation<'a>[src]

type Output = Option<DataPtr<'a>>

Loading content...