pub enum Term {
Var(String),
Const(String),
Typed {
value: Box<Term>,
type_annotation: TypeAnnotation,
},
}Variants§
Implementations§
Source§impl Term
impl Term
pub fn var(name: impl Into<String>) -> Self
pub fn constant(name: impl Into<String>) -> Self
Sourcepub fn typed_var(name: impl Into<String>, type_name: impl Into<String>) -> Self
pub fn typed_var(name: impl Into<String>, type_name: impl Into<String>) -> Self
Create a typed variable
Sourcepub fn typed_const(
name: impl Into<String>,
type_name: impl Into<String>,
) -> Self
pub fn typed_const( name: impl Into<String>, type_name: impl Into<String>, ) -> Self
Create a typed constant
Sourcepub fn with_type(self, type_name: impl Into<String>) -> Self
pub fn with_type(self, type_name: impl Into<String>) -> Self
Attach a type annotation to an existing term
pub fn is_var(&self) -> bool
pub fn is_const(&self) -> bool
pub fn name(&self) -> &str
Sourcepub fn get_type(&self) -> Option<&TypeAnnotation>
pub fn get_type(&self) -> Option<&TypeAnnotation>
Get the type annotation if present
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Term
impl<'de> Deserialize<'de> for Term
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more