Referee

Trait Referee 

Source
pub trait Referee {
    // Required methods
    fn is_allowed<L>(&self, lattice: &L, bbas: &[&Assignment<L::Item>]) -> bool
       where L: Lattice,
             L::Item: Eq + Ord + Hash;
    unsafe fn unsafe_from_conditions<L>(
        &self,
        lattice: &L,
        bbas: &[&Assignment<L::Item>],
        conditions: SafeArray<'_, L::Item>,
    ) -> Result<Assignment<L::Item>, String>
       where L: Lattice,
             L::Item: Eq + Ord + Hash;

    // Provided method
    fn from_conditions<L>(
        &self,
        lattice: &L,
        bbas: &[&Assignment<L::Item>],
        conditions: SafeArray<'_, L::Item>,
    ) -> Result<Assignment<L::Item>, String>
       where L: Lattice,
             L::Item: Eq + Ord + Hash { ... }
}
Expand description

Trait defining Referee functions

Required Methods§

Source

fn is_allowed<L>(&self, lattice: &L, bbas: &[&Assignment<L::Item>]) -> bool
where L: Lattice, L::Item: Eq + Ord + Hash,

Test if fusion is allowed

  • does not concern lattice coherence, which is tested by from_conditions
  • typically concerns the number of entries or the algebraic properties of lattice
  • lattice: &L : reference lattice
  • bbas: &[&Assignment<L::Item>] : sequence of bbas to be fused
  • Output: a boolean
Source

unsafe fn unsafe_from_conditions<L>( &self, lattice: &L, bbas: &[&Assignment<L::Item>], conditions: SafeArray<'_, L::Item>, ) -> Result<Assignment<L::Item>, String>
where L: Lattice, L::Item: Eq + Ord + Hash,

unsafe conditional referee decision

  • lattice: &L : reference lattice
  • bbas: &[&Assignment<L::Item>] : sequence of bbas to be fused
  • conditions: SafeArray<L::Item> : conditionning safe elements array
  • Output: fused assigment or error

Provided Methods§

Source

fn from_conditions<L>( &self, lattice: &L, bbas: &[&Assignment<L::Item>], conditions: SafeArray<'_, L::Item>, ) -> Result<Assignment<L::Item>, String>
where L: Lattice, L::Item: Eq + Ord + Hash,

Conditional referee decision

  • lattice: &L : reference lattice
  • bbas: &[&Assignment<L::Item>] : sequence of bbas to be fused
  • conditions: SafeArray<L::Item> : conditionning safe elements array
  • Output: fused assigment or error

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§