[−][src]Struct polar_core::terms::Term
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]
src_id: u64,
left: usize,
right: usize,
value: Value
) -> Self
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
H: Hasher,
Hash just the value, not source information.
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Term> for Term
[src]
impl Serialize for Term
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,