1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
//! Setup trait.

use crate::{err::Error, ord::Set};

/// Types implementing this trait can be linked to a set to produce a referenced type.
pub trait Link<'a, T> {
    /// Type to be built.
    type Inst;

    /// Link the instance type.
    /// # Errors
    /// if a field could not be referenced.
    fn link(self, set: &'a Set<T>) -> Result<Self::Inst, Error>;
}