Trait sodg::Relay

source ·
pub trait Relay {
    fn re(&self, v: u32, a: &str) -> Result<String>;
}
Expand description

A relay that is used by Sodg::find() when it can’t find an attribute.

The finding algorithm asks the relay for the name of the attribute to use instead of the not found one, which is provided as the a argument to the relay. The v argument provided to the relay is the ID of the vertex where the attribute a is not found.

A relay may return a new vertex ID as a string "ν42", for example. Pretty much anything that the relay returns will be used as a new search string, starting from the v vertex.

Required Methods§

source

fn re(&self, v: u32, a: &str) -> Result<String>

A method to be called when the searching algorithm fails to find the required attribute.

The method must accept two arguments:

  1. the ID of the vertex where the search algorithm found a problem,
  2. the name of the edge it is trying to find.

The method must return a new locator, which the algorithm will use. If it is just a string, it will be treated as a name of the attribute to try instead. If it starts from "ν", it is treated as an absolute locator on the entire graph.

Implementors§