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:

  1. 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

source

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:

  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 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.

Trait Implementations§

source§

impl Relay for LambdaRelay

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. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.