pub struct Matcher { /* private fields */ }Expand description
Ordered rules that tie claims to a directory account.
Implementations§
Source§impl Matcher
impl Matcher
Sourcepub fn builder(config: MatcherConfig) -> MatcherBuilder
pub fn builder(config: MatcherConfig) -> MatcherBuilder
Starts a matcher that takes pin sources.
Sourcepub fn new(config: MatcherConfig) -> Result<Self, MatcherError>
pub fn new(config: MatcherConfig) -> Result<Self, MatcherError>
Checks config and compiles it, for rules that name no pin source.
§Errors
A by other than name, email, id or filter; a template with an unmatched
brace, a claim name that is not lowercase words, a filter that is not lower,
upper, local or domain, or no claim at all; a filter template that is not one
balanced parenthesised group; a rule naming a pin source; a template using local
with neither a domain nor pins; a domain that is empty, holds @ or whitespace,
or is given to a template without local.
Sourcepub fn resolve(
&self,
lookup: &Lookup,
directory: &dyn Directory,
) -> Result<Matched, ProviderError>
pub fn resolve( &self, lookup: &Lookup, directory: &dyn Directory, ) -> Result<Matched, ProviderError>
Finds the account lookup names.
A lookup that is not by: "claims", or has no claims, is looked up as it is, except a
by: "filter" one, which is refused (NotFound): filters come only from the rules’
escaped templates.
§Errors
When the directory or a pin source cannot answer, or a rule renders more than
MAX_CANDIDATES lookups.