Trait LabelOrder

Source
pub trait LabelOrder<LABEL> {
    // Required method
    fn less_than(&self, l1: &EdgeOrData<LABEL>, l2: &EdgeOrData<LABEL>) -> bool;
}
Expand description

Strict partial order on labels. Used to perform shadowing.

For example, suppose that in some scope s, declarations for some query are reachable via an Lex edge and an Imp edge (for lexical parent and import, respectively). When the label order Indicates Lex < Imp (i.e., declarations from a lexically enclosing scope have higher priority), the declaration over the Imp edge is shadowed, and will thus not be included in the environment. If Imp < Lex, imports have higher priority, and that one will be included. Otherwise, paths to both declarations are included in the environment.

Required Methods§

Source

fn less_than(&self, l1: &EdgeOrData<LABEL>, l2: &EdgeOrData<LABEL>) -> bool

Implementors§

Source§

impl<LABEL> LabelOrder<LABEL> for DefaultLabelOrder

Source§

impl<LABEL, T> LabelOrder<LABEL> for T
where T: for<'a, 'b> Fn(&'a EdgeOrData<LABEL>, &'b EdgeOrData<LABEL>) -> bool,