pub struct Resources {
pub chosen: Option<Dict>,
pub page: Option<Dict>,
}Expand description
The resource dictionaries a lookup consults.
Fields§
§chosen: Option<Dict>The dictionary chosen by the whole-dictionary rule.
page: Option<Dict>The page’s, for the one-level category fallback.
Implementations§
Source§impl Resources
impl Resources
Sourcepub fn choose(
own: Option<Dict>,
parent: Option<Dict>,
page: Option<Dict>,
) -> Self
pub fn choose( own: Option<Dict>, parent: Option<Dict>, page: Option<Dict>, ) -> Self
Choose the dictionary a form will use.
The first non-null of the three, which is why a form with any
/Resources at all stops seeing its parent’s.
Sourcepub fn for_page(page: Option<Dict>) -> Self
pub fn for_page(page: Option<Dict>) -> Self
A page’s own resources, where the chosen dictionary and the page’s are the same.
Sourcepub fn holder<R: Resolve>(&self, category: &Name, r: &R) -> Option<Dict>
pub fn holder<R: Resolve>(&self, category: &Name, r: &R) -> Option<Dict>
The dictionary holding category, applying the one-level fallback.
Sourcepub fn find<R: Resolve>(
&self,
category: &Name,
name: &Name,
r: &R,
) -> Option<Object>
pub fn find<R: Resolve>( &self, category: &Name, name: &Name, r: &R, ) -> Option<Object>
The resolved object a named resource denotes.
Sourcepub fn find_ref<R: Resolve>(
&self,
category: &Name,
name: &Name,
r: &R,
) -> Option<ObjRef>
pub fn find_ref<R: Resolve>( &self, category: &Name, name: &Name, r: &R, ) -> Option<ObjRef>
The reference a named resource is reached through, when it is indirect.
The identity a cache keys on. A resource written inline in the resource dictionary has no reference and therefore no identity to share, which is exactly right: two inline copies of the same dictionary really are two resources.