[][src]Struct polar_core::terms::Term

pub struct Term { /* fields omitted */ }

Represents a concrete instance of a Polar value

Implementations

impl Term[src]

pub fn new_temporary(value: Value) -> Self[src]

Creates a new term for a temporary variable

pub fn new_from_ffi(value: Value) -> Self[src]

Creates a new term from the parser

pub fn new_from_parser(
    src_id: u64,
    left: usize,
    right: usize,
    value: Value
) -> Self
[src]

Creates a new term from the parser

pub fn new_from_test(value: Value) -> Self[src]

Creates a new term from a test value

pub fn clone_with_value(&self, value: Value) -> Self[src]

Create a new Term, cloning the source info of self but with the new value

pub fn replace_value(&mut self, value: Value)[src]

Replace the value of self

pub fn offset(&self) -> usize[src]

pub fn span(&self) -> Option<(usize, usize)>[src]

pub fn value(&self) -> &Value[src]

Get a reference to the underlying data of this term

pub fn is_ground(&self) -> bool[src]

pub fn variables<'set>(&self, vars: &'set mut HashSet<Symbol>)[src]

Get a set of all the variables used within a term.

pub fn get_source_id(&self) -> Option<u64>[src]

Trait Implementations

impl Clone for Term[src]

impl Debug for Term[src]

impl<'de> Deserialize<'de> for Term[src]

impl Display for Term[src]

impl Eq for Term[src]

impl Hash for Term[src]

fn hash<H>(&self, state: &mut H) where
    H: Hasher
[src]

Hash just the value, not source information.

impl PartialEq<Term> for Term[src]

impl Serialize for Term[src]

impl ToPolarString for Term[src]

Auto Trait Implementations

impl RefUnwindSafe for Term

impl Send for Term

impl Sync for Term

impl Unpin for Term

impl UnwindSafe for Term

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.