logic/
literals.rs

1use crate::Formula;
2
3#[derive(Debug)]
4pub enum Error {}
5
6impl std::fmt::Display for Error {
7    fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8        unreachable!("No variants exist for literals::Error")
9    }
10}
11
12impl std::error::Error for Error {}
13
14pub struct True;
15
16impl<T> Formula<T> for True {
17    type Error = Error;
18
19    fn satisfied_by(&self, _value: &T) -> Result<bool, Self::Error> {
20        Ok(true)
21    }
22}
23
24pub struct False;
25
26impl<T> Formula<T> for False {
27    type Error = Error;
28
29    fn satisfied_by(&self, _value: &T) -> Result<bool, Self::Error> {
30        Ok(false)
31    }
32}