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§
Sourcefn all_slot_occurrences_mut(&mut self) -> Vec<&mut Slot>
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.
Sourcefn public_slot_occurrences_mut(&mut self) -> Vec<&mut Slot>
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.
Sourcefn applied_id_occurrences_mut(&mut self) -> Vec<&mut AppliedId>
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.
fn all_slot_occurrences(&self) -> Vec<Slot>
fn public_slot_occurrences(&self) -> Vec<Slot>
fn applied_id_occurrences(&self) -> Vec<&AppliedId>
Sourcefn to_syntax(&self) -> Vec<SyntaxElem>
fn to_syntax(&self) -> Vec<SyntaxElem>
This function will be used to display your E-Node.
Sourcefn from_syntax(_: &[SyntaxElem]) -> Option<Self>
fn from_syntax(_: &[SyntaxElem]) -> Option<Self>
This function will be used to parse your E-Node.
fn slots(&self) -> SmallHashSet<Slot>
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".