Trait aterm::ATerm
[−]
[src]
pub trait ATerm { type Rec: Borrow<Self>; type Blob; type Cons: Cons; fn into_inner(self) -> ATermInner<Self::Rec, Self::Blob, Self::Cons>; fn as_inner(&self) -> &ATermInner<Self::Rec, Self::Blob, Self::Cons>; fn get_int(&self) -> Option<i32> { ... } fn get_long(&self) -> Option<i64> { ... } fn get_real(&self) -> Option<f32> { ... } fn get_application(&self) -> Option<(&Self::Cons, &[Self::Rec])> { ... } fn get_list(&self) -> Option<&[Self::Rec]> { ... } fn get_placeholder(&self) -> Option<&TermPlaceholder<Self::Rec>> { ... } fn get_blob(&self) -> Option<&Self::Blob> { ... } fn get_string(&self) -> Option<String> { ... } fn get_tuple(&self) -> Option<&[Self::Rec]> { ... } }
The generic description of what it means to be an ATerm
. That is: you need to be convertible
to an ATermInner
to provide the minimum of term and annotations. Also gives you useful getters
so matching on different terms is easier.
Associated Types
type Rec: Borrow<Self>
Basically the current type, but you may want to add something extra, so this is more flexible.
type Blob
The extension point to add more variants to terms.
type Cons: Cons
The type of the constructor to use
Required Methods
fn into_inner(self) -> ATermInner<Self::Rec, Self::Blob, Self::Cons>
fn as_inner(&self) -> &ATermInner<Self::Rec, Self::Blob, Self::Cons>
Provided Methods
fn get_int(&self) -> Option<i32>
fn get_long(&self) -> Option<i64>
fn get_real(&self) -> Option<f32>
fn get_application(&self) -> Option<(&Self::Cons, &[Self::Rec])>
fn get_list(&self) -> Option<&[Self::Rec]>
fn get_placeholder(&self) -> Option<&TermPlaceholder<Self::Rec>>
fn get_blob(&self) -> Option<&Self::Blob>
fn get_string(&self) -> Option<String>
fn get_tuple(&self) -> Option<&[Self::Rec]>
Implementors
impl<'s, B> ATerm for ATerm<'s, B>
impl<Rec, B, S> ATerm for ATermInner<Rec, B, S> where
Rec: Borrow<ATermInner<Rec, B, S>>,
S: Cons,