pub trait ReprDomainLevel {
type Assignment: ReprAssignment;
type DeclLevel: ReprDeclLevel<DomainLevel = Self, Assignment = Self::Assignment>;
const RULE: &'static dyn ReprRuleStored;
// Required methods
fn init(dom: Moo<Domain>) -> Result<Self, ReprInitError>
where Self: Sized;
fn compactness_score(&self) -> usize;
fn instantiate(
self,
decl: DeclarationPtr,
) -> Result<(Self::DeclLevel, SymbolTable, Vec<Expression>), ReprInstantiateError>;
fn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError>;
}Required Associated Constants§
const RULE: &'static dyn ReprRuleStored
Required Associated Types§
type Assignment: ReprAssignment
type DeclLevel: ReprDeclLevel<DomainLevel = Self, Assignment = Self::Assignment>
Required Methods§
Sourcefn init(dom: Moo<Domain>) -> Result<Self, ReprInitError>where
Self: Sized,
fn init(dom: Moo<Domain>) -> Result<Self, ReprInitError>where
Self: Sized,
Initialise this representation at the domain level.
Returns Err if it is not applicable to the given domain.
Sourcefn compactness_score(&self) -> usize
fn compactness_score(&self) -> usize
Number of assignments admitted by the domains introduced by this representation. Multiple representation-variable domains are combined as a Cartesian product.
Sourcefn instantiate(
self,
decl: DeclarationPtr,
) -> Result<(Self::DeclLevel, SymbolTable, Vec<Expression>), ReprInstantiateError>
fn instantiate( self, decl: DeclarationPtr, ) -> Result<(Self::DeclLevel, SymbolTable, Vec<Expression>), ReprInstantiateError>
Construct a concrete instance of this representation Returns:
- The declaration-level representation
- Representation variables to add to the symbol table
- List of structural constraints
Sourcefn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError>
fn down(&self, value: Literal) -> Result<Self::Assignment, ReprDownError>
Given an instance of this representation for some domain, and a value in that domain, construct the corresponding assignment of representation variables.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".