pub trait Literal: Sized + Clone {
type F;
// Required methods
fn literal(x: Self::F) -> Self;
fn to_literal(self) -> Result<Self::F, Self>;
fn to_literal_ref(&self) -> Option<&Self::F>;
fn as_literal(&self, constants: &Constants<Self::F>) -> Self;
}
Required Associated Types§
Required Methods§
fn literal(x: Self::F) -> Self
fn to_literal(self) -> Result<Self::F, Self>
fn to_literal_ref(&self) -> Option<&Self::F>
sourcefn as_literal(&self, constants: &Constants<Self::F>) -> Self
fn as_literal(&self, constants: &Constants<Self::F>) -> Self
Obtains the representation of some constants as a literal. This is useful before converting Kimchi expressions with constants to folding compatible expressions.