Trait aterm::ATermFactory
[−]
[src]
pub trait ATermFactory<'s> { type ATerm: ATerm<'s, Rec = Self::ATermRef>; type ATermRef: Borrow<Self::ATerm>; fn int(&'s self, value: i32) -> Self::ATermRef; fn string<S>(&'s self, value: S) -> Self::ATermRef
where
S: Into<Cow<'s, str>>; fn tuple<I>(&'s self, children: I) -> Self::ATermRef
where
I: IntoIterator<Item = Self::ATermRef>; fn real(&'s self, value: f32) -> Self::ATermRef; fn application<I, S>(
&'s self,
constructor: S,
children: I
) -> Self::ATermRef
where
I: IntoIterator<Item = Self::ATermRef>,
S: Into<Cow<'s, str>>; fn list<I>(&'s self, value: I) -> Self::ATermRef
where
I: IntoIterator<Item = Self::ATermRef>; fn placeholder(
&'s self,
value: TermPlaceholder<Self::ATermRef>
) -> Self::ATermRef; fn blob(&'s self, value: <Self::ATerm as ATerm<'s>>::Blob) -> Self::ATermRef; fn long(&'s self, value: i64) -> Self::ATermRef; fn with_annos<A>(&'s self, term: Self::ATermRef, annos: A) -> Self::ATermRef
where
A: IntoIterator<Item = Self::ATermRef>; }
An all-in-one package for building ATerm
s. Maybe be pure, or have internal mutability to give
you maximally shared ATerm
s.
Associated Types
type ATerm: ATerm<'s, Rec = Self::ATermRef>
The ATerm
the factory builds
type ATermRef: Borrow<Self::ATerm>
The reference to an ATerm
that's returned. You usually want these to be cheaply cloneable!
Required Methods
fn int(&'s self, value: i32) -> Self::ATermRef
fn string<S>(&'s self, value: S) -> Self::ATermRef where
S: Into<Cow<'s, str>>,
S: Into<Cow<'s, str>>,
The string variant in ATerms is represented as an application with zero children!
fn tuple<I>(&'s self, children: I) -> Self::ATermRef where
I: IntoIterator<Item = Self::ATermRef>,
I: IntoIterator<Item = Self::ATermRef>,
The tuple in ATerms is represented as an application with an empty constructor string!
fn real(&'s self, value: f32) -> Self::ATermRef
fn application<I, S>(&'s self, constructor: S, children: I) -> Self::ATermRef where
I: IntoIterator<Item = Self::ATermRef>,
S: Into<Cow<'s, str>>,
I: IntoIterator<Item = Self::ATermRef>,
S: Into<Cow<'s, str>>,
fn list<I>(&'s self, value: I) -> Self::ATermRef where
I: IntoIterator<Item = Self::ATermRef>,
I: IntoIterator<Item = Self::ATermRef>,
fn placeholder(
&'s self,
value: TermPlaceholder<Self::ATermRef>
) -> Self::ATermRef
&'s self,
value: TermPlaceholder<Self::ATermRef>
) -> Self::ATermRef
fn blob(&'s self, value: <Self::ATerm as ATerm<'s>>::Blob) -> Self::ATermRef
fn long(&'s self, value: i64) -> Self::ATermRef
fn with_annos<A>(&'s self, term: Self::ATermRef, annos: A) -> Self::ATermRef where
A: IntoIterator<Item = Self::ATermRef>,
A: IntoIterator<Item = Self::ATermRef>,
Implementors
impl<'s, B: 's + Clone + Hash + Eq, H: 's + BuildHasher + Default> ATermFactoryT<'s> for aterm::rc::shared::ATermFactory<'s, B, H> type ATerm = ATerm<'s, B>; type ATermRef = Rc<ATerm<'s, B>>;
impl<'s, B, H> ATermFactoryT<'s> for aterm::rc::ATermFactory<B, H> where
B: 's + Clone,
H: 's + BuildHasher + Default, type ATerm = ATerm<'s, B>; type ATermRef = Rc<ATerm<'s, B>>;