Struct sodg::LambdaRelay
source · pub struct LambdaRelay { /* private fields */ }
Expand description
A Relay
that is made of a lambda function.
The function must accept two arguments:
v
is the ID of the vertex where an attribute is not found, and 2)a
is the name of the attribute. The function must return a new locator where the search algorithm must continue. It can be just a name of a new attribute, or an absolute locator (starting from"ν"
) with dots inside.
Implementations§
source§impl LambdaRelay
impl LambdaRelay
sourcepub fn new(lambda: fn(_: u32, _: &str) -> Result<String>) -> Self
pub fn new(lambda: fn(_: u32, _: &str) -> Result<String>) -> Self
Make a new instance of LambdaRelay
with the encapsulated
lambda function.
The function must accept three arguments:
- the ID of the vertex where the search algorithm found a problem,
- the name of the edge it is trying to find.
The function 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.