pub struct Function {
pub unique_id: u32,
pub resistant_id: u32,
fn_container: FnContainer,
}
Expand description
A function symbol with fixed arity and fixed types.
Fields§
§unique_id: u32
Unique ID of this function. Uniqueness is guaranteed across all Term
s ever created. Cloning
change this ID.
resistant_id: u32
ID of this function. This id stays the same during cloning.
fn_container: FnContainer
Implementations§
source§impl Function
impl Function
pub fn new(
shape: DynamicFunctionShape,
dynamic_fn: Box<dyn DynamicFunction>
) -> Self
pub fn arity(&self) -> u16
pub fn is_constant(&self) -> bool
pub fn name(&self) -> &'static str
pub fn shape(&self) -> &DynamicFunctionShape
pub fn dynamic_fn(&self) -> &dyn DynamicFunction
pub fn change_function(
&mut self,
shape: DynamicFunctionShape,
dynamic_fn: Box<dyn DynamicFunction>
)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Function> for Function
impl PartialEq<Function> for Function
impl Eq for Function
Auto Trait Implementations§
impl !RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl !UnwindSafe for Function
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
The Resulting [
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.