Skip to main content

Language

Trait Language 

Source
pub trait Language:
    Debug
    + Clone
    + Hash
    + Eq
    + Ord {
    // Required methods
    fn all_slot_occurrences_mut(&mut self) -> Vec<&mut Slot>;
    fn public_slot_occurrences_mut(&mut self) -> Vec<&mut Slot>;
    fn applied_id_occurrences_mut(&mut self) -> Vec<&mut AppliedId>;
    fn all_slot_occurrences(&self) -> Vec<Slot>;
    fn public_slot_occurrences(&self) -> Vec<Slot>;
    fn applied_id_occurrences(&self) -> Vec<&AppliedId>;
    fn to_syntax(&self) -> Vec<SyntaxElem>;
    fn from_syntax(_: &[SyntaxElem]) -> Option<Self>;
    fn slots(&self) -> SmallHashSet<Slot>;
    fn weak_shape_inplace(&mut self) -> SlotMap;
}
Expand description

A trait to define your Language (i.e. your E-Node type).

Required Methods§

Source

fn all_slot_occurrences_mut(&mut self) -> Vec<&mut Slot>

List the mutable references of all child Slots in your E-Node, in order of occurrence.

Source

fn public_slot_occurrences_mut(&mut self) -> Vec<&mut Slot>

List the mutable references to all public child Slots in your E-Node, in order of occurrence.

Public Slots are those, which are visible from the outside of that e-node.

  • A typical example would be a (var $x) e-node, which has a public slot $x.
  • A typical counter-example would be the (lam $x body) e-node, which has a private slot $x.
Source

fn applied_id_occurrences_mut(&mut self) -> Vec<&mut AppliedId>

List the mutable references to all child AppliedIds in your E-Node, in the order of occurrence.

Source

fn all_slot_occurrences(&self) -> Vec<Slot>

Source

fn public_slot_occurrences(&self) -> Vec<Slot>

Source

fn applied_id_occurrences(&self) -> Vec<&AppliedId>

Source

fn to_syntax(&self) -> Vec<SyntaxElem>

This function will be used to display your E-Node.

Source

fn from_syntax(_: &[SyntaxElem]) -> Option<Self>

This function will be used to parse your E-Node.

Source

fn slots(&self) -> SmallHashSet<Slot>

Source

fn weak_shape_inplace(&mut self) -> SlotMap

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§