Struct term_rewriting::Operator [−][src]
pub struct Operator { /* fields omitted */ }
A symbol with fixed arity. Only carries meaning alongside a Signature
.
To construct an Operator
, use Signature::new_op
.
Methods
impl Operator
[src]
impl Operator
pub fn arity(self, sig: &Signature) -> u32
[src]
pub fn arity(self, sig: &Signature) -> u32
Returns an Operator
's arity.
Examples
let mut sig = Signature::default(); let op = sig.new_op(2, Some("Z".to_string())); assert_eq!(op.arity(&sig), 2);
pub fn name(self, sig: &Signature) -> Option<&str>
[src]
pub fn name(self, sig: &Signature) -> Option<&str>
Returns an Operator
's name.
Examples
let mut sig = Signature::default(); let op = sig.new_op(2, Some("Z".to_string())); assert_eq!(op.name(&sig), Some("Z"));
pub fn display(self, sig: &Signature) -> String
[src]
pub fn display(self, sig: &Signature) -> String
Returns a human-readable, string representation of an Operator
.
Examples
let mut sig = Signature::default(); let op = sig.new_op(2, Some("Z".to_string())); assert_eq!(op.display(&sig), "Z");
Trait Implementations
impl Debug for Operator
[src]
impl Debug for Operator
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for Operator
[src]
impl Copy for Operator
impl Clone for Operator
[src]
impl Clone for Operator
fn clone(&self) -> Operator
[src]
fn clone(&self) -> Operator
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Operator
[src]
impl PartialEq for Operator
fn eq(&self, other: &Operator) -> bool
[src]
fn eq(&self, other: &Operator) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Operator) -> bool
[src]
fn ne(&self, other: &Operator) -> bool
This method tests for !=
.
impl Eq for Operator
[src]
impl Eq for Operator
impl Hash for Operator
[src]
impl Hash for Operator
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl From<Operator> for Atom
[src]
impl From<Operator> for Atom