Skip to main content

ReprDeclLevel

Trait ReprDeclLevel 

Source
pub trait ReprDeclLevel:
    Sized
    + Clone
    + Send
    + Sync
    + Debug
    + Serialize
    + for<'de> Deserialize<'de>
    + 'static {
    type Assignment: ReprAssignment;
    type DomainLevel: ReprDomainLevel<DeclLevel = Self, Assignment = Self::Assignment>;

    const RULE: &'static dyn ReprRuleStored;

    // Required methods
    fn to_domain_level(self) -> Self::DomainLevel;
    fn lookup_via(
        &self,
        lu: &Box<dyn Fn(&DeclarationPtr) -> Option<Literal> + '_>,
    ) -> Result<Self::Assignment, ReprUpError>;
    fn repr_vars(&self) -> VecDeque<DeclarationPtr>;

    // Provided methods
    fn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError> { ... }
    fn lookup(
        &self,
        raw_assignment: &HashMap<Name, Literal>,
    ) -> Result<Self::Assignment, ReprUpError> { ... }
}

Required Associated Constants§

Source

const RULE: &'static dyn ReprRuleStored

Required Associated Types§

Source

type Assignment: ReprAssignment

Source

type DomainLevel: ReprDomainLevel<DeclLevel = Self, Assignment = Self::Assignment>

Required Methods§

Source

fn to_domain_level(self) -> Self::DomainLevel

Convert an instance of this representation back to domain level

Source

fn lookup_via( &self, lu: &Box<dyn Fn(&DeclarationPtr) -> Option<Literal> + '_>, ) -> Result<Self::Assignment, ReprUpError>

Look up the values of representation variables

Source

fn repr_vars(&self) -> VecDeque<DeclarationPtr>

Get the list of representation variables, in an arbitrary order

Provided Methods§

Source

fn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError>

Given an instance of this representation for some variable, and a value of the variable, construct the corresponding assignment of representation variables.

Source

fn lookup( &self, raw_assignment: &HashMap<Name, Literal>, ) -> Result<Self::Assignment, ReprUpError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§