Skip to main content

Arena

Struct Arena 

Source
pub struct Arena { /* private fields */ }

Implementations§

Source§

impl<'arena> Arena

Source

pub fn new(interner: Arc<Mutex<Interner>>) -> Self

Source

pub fn new_with_global_interner() -> Self

Source

pub fn intern(&'arena self, name: &str) -> u32

Source

pub fn lookup_opt(&'arena self, name: &str) -> Option<u32>

Source

pub fn name(&'arena self, name: &str) -> Const<'arena>

Source

pub fn variable(&'arena self, name: &str) -> &'arena BaseTerm<'arena>

Source

pub fn const_(&'arena self, c: Const<'arena>) -> &'arena BaseTerm<'arena>

Source

pub fn atom( &'arena self, p: PredicateIndex, args: &[&'arena BaseTerm<'arena>], ) -> &'arena Atom<'arena>

Source

pub fn apply_fn( &'arena self, fun: FunctionIndex, args: &[&'arena BaseTerm<'arena>], ) -> &'arena BaseTerm<'arena>

Source

pub fn alloc<T>(&self, x: T) -> &mut T

Source

pub fn alloc_slice_copy<T: Copy>(&self, x: &[T]) -> &[T]

Source

pub fn alloc_str(&'arena self, s: &str) -> &'arena str

Source

pub fn new_query(&'arena self, p: PredicateIndex) -> Atom<'arena>

Source

pub fn lookup_name(&self, name_index: u32) -> Option<&'static str>

Given a name index, returns the name.

Source

pub fn lookup_name_index(&self, name: &str) -> Option<u32>

Given a name, returns the index of the name if it exists in the interner.

Source

pub fn predicate_name( &self, predicate_index: PredicateIndex, ) -> Option<&'static str>

Given predicate index, returns name of predicate symbol.

Source

pub fn predicate_arity(&self, predicate_index: PredicateIndex) -> Option<u8>

Given predicate index, returns arity of predicate symbol.

Source

pub fn function_name( &self, function_index: FunctionIndex, ) -> Option<&'static str>

Given function index, returns name of function symbol.

Source

pub fn lookup_predicate_sym( &'arena self, predicate_name: u32, ) -> Option<PredicateIndex>

Returns index for this predicate symbol.

Source

pub fn variable_sym(&'arena self, name: &str) -> VariableIndex

Constructs a new variable symbol.

Source

pub fn function_sym( &'arena self, name: &str, arity: Option<u8>, ) -> FunctionIndex

Source

pub fn predicate_sym( &'arena self, name: &str, arity: Option<u8>, ) -> PredicateIndex

Source

pub fn copy_function_sym<'src>( &'arena self, src: &'src Arena, f: FunctionIndex, ) -> FunctionIndex

Source

pub fn copy_predicate_sym<'src>( &'arena self, src: &'src Arena, p: PredicateIndex, ) -> PredicateIndex

Source

pub fn copy_atom<'src>( &'arena self, src: &'src Arena, atom: &'src Atom<'src>, ) -> &'arena Atom<'arena>

Source

pub fn copy_base_term<'src>( &'arena self, src: &'src Arena, b: &'src BaseTerm<'src>, ) -> &'arena BaseTerm<'arena>

Source

pub fn copy_const<'src>( &'arena self, src: &'src Arena, c: &'src Const<'src>, ) -> &'arena Const<'arena>

Source

pub fn copy_transform<'src>( &'arena self, src: &'src Arena, stmt: &'src TransformStmt<'src>, ) -> &'arena TransformStmt<'arena>

Source

pub fn copy_clause<'src>( &'arena self, src: &'src Arena, src_clause: &'src Clause<'src>, ) -> &'arena Clause<'arena>

Auto Trait Implementations§

§

impl !Freeze for Arena

§

impl !RefUnwindSafe for Arena

§

impl Send for Arena

§

impl !Sync for Arena

§

impl Unpin for Arena

§

impl UnsafeUnpin for Arena

§

impl !UnwindSafe for Arena

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.