pub struct LinkTypes(/* private fields */);Expand description
A source’s link_types configuration: each link type a source mirrors natively, with the
destination’s word for it.
Implementations§
Source§impl LinkTypes
impl LinkTypes
Sourcepub fn checked(
kind: &str,
configured: &BTreeMap<String, LinkTypeConfig>,
words: &[&str],
reasons: &[(&str, &str)],
) -> Result<Self, SourceError>
pub fn checked( kind: &str, configured: &BTreeMap<String, LinkTypeConfig>, words: &[&str], reasons: &[(&str, &str)], ) -> Result<Self, SourceError>
configured checked against words, the native relations the kind plugin can mirror
a link as — refusing any other word, naming the type and the word, and, for a word
reasons names, the plugin’s own reason it is never one.
§Errors
SourceError::Config naming the first type whose native word the plugin cannot
mirror as.
Sourcepub fn type_name(name: &str) -> Result<&str, &'static str>
pub fn type_name(name: &str) -> Result<&str, &'static str>
name as a link’s type: without surrounding whitespace — or why it names no type a link
can carry, because it is empty or holds a line break or another control character, which
its ## Links section could not list on one line. The one rule a link call, a stored
link and a source’s link_types are each held to.
§Errors
Why name names no type, as words that follow “which”.
Sourcepub fn native(&self, link_type: &str) -> Option<&NativeWord>
pub fn native(&self, link_type: &str) -> Option<&NativeWord>
The native word link_type is mirrored as, or None for a type kept in metadata alone.
Sourcepub fn mirrored(&self) -> &BTreeMap<String, NativeWord>
pub fn mirrored(&self) -> &BTreeMap<String, NativeWord>
Every mirrored type and its word.