Struct dae_parser::local_map::LocalMap
source · pub struct LocalMap<'a, T: ?Sized>(pub HashMap<&'a str, &'a T>);
Expand description
A map for looking up elements of type T
in the document by ID.
Tuple Fields§
§0: HashMap<&'a str, &'a T>
Implementations§
source§impl<'a, T: ?Sized> LocalMap<'a, T>
impl<'a, T: ?Sized> LocalMap<'a, T>
sourcepub fn get_name(&self, n: &NameRef<T>) -> Option<&'a T>
pub fn get_name(&self, n: &NameRef<T>) -> Option<&'a T>
Look up an element by ID, in a NameRef
.
sourcepub fn get_raw(&self, url: &Url) -> Option<&'a T>
pub fn get_raw(&self, url: &Url) -> Option<&'a T>
Look up an element by URL reference.
This is a local map, meaning that it does not support references to URLs which are not
of the special form #ref
, referring to an element with ID ref
in the same document.
sourcepub fn get(&self, url: &UrlRef<T>) -> Option<&'a T>
pub fn get(&self, url: &UrlRef<T>) -> Option<&'a T>
Look up an element by URL reference.
This is a simple wrapper around get_raw
,
but it has better type safety, since it ensures that the reference is a reference to a T
.
This is a local map, meaning that it does not support references to URLs which are not
of the special form #ref
, referring to an element with ID ref
in the same document.