Trait aterm::ATerm
[−]
[src]
pub trait ATerm { type Rec: Borrow<Self>; type Blob; fn into_inner(self) -> ATermInner<Self::Rec, Self::Blob>; fn as_inner(&self) -> &ATermInner<Self::Rec, Self::Blob>; fn get_int(&self) -> Option<i32> { ... } fn get_long(&self) -> Option<i64> { ... } fn get_real(&self) -> Option<f32> { ... } fn get_application(&self) -> Option<(&str, &[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.
Required Methods
fn into_inner(self) -> ATermInner<Self::Rec, Self::Blob>
fn as_inner(&self) -> &ATermInner<Self::Rec, Self::Blob>
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<(&str, &[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<B> ATerm for ATerm<B>
impl<Rec, B> ATerm for ATermInner<Rec, B> where
Rec: Borrow<ATermInner<Rec, B>>,