pub struct Resources<'a> {
pub ext_g_states: Dict<'a>,
pub fonts: Dict<'a>,
pub properties: Dict<'a>,
pub color_spaces: Dict<'a>,
pub x_objects: Dict<'a>,
pub patterns: Dict<'a>,
pub shadings: Dict<'a>,
/* private fields */
}
Expand description
A structure keeping track of the resources of a page.
Fields§
§ext_g_states: Dict<'a>
The raw dictionary of external graphics states.
fonts: Dict<'a>
The raw dictionary of fonts.
properties: Dict<'a>
The raw dictionary of properties.
color_spaces: Dict<'a>
The raw dictionary of color spaces.
x_objects: Dict<'a>
The raw dictionary of x objects.
patterns: Dict<'a>
The raw dictionary of patterns.
shadings: Dict<'a>
The raw dictionary of shadings.
Implementations§
Source§impl<'a> Resources<'a>
impl<'a> Resources<'a>
Sourcepub fn from_parent(resources: Dict<'a>, parent: Resources<'a>) -> Resources<'a>
pub fn from_parent(resources: Dict<'a>, parent: Resources<'a>) -> Resources<'a>
Create a new Resources
object from a dictionary with a parent.
Sourcepub fn resolve_ref<T: ObjectLike<'a>>(&self, ref_: ObjRef) -> Option<T>
pub fn resolve_ref<T: ObjectLike<'a>>(&self, ref_: ObjRef) -> Option<T>
Resolve an object reference to an object.
Sourcepub fn parent(&self) -> Option<&Resources<'a>>
pub fn parent(&self) -> Option<&Resources<'a>>
Get the parent in the resource, chain, if available.
Sourcepub fn get_ext_g_state<U>(
&self,
name: Name<'_>,
cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>,
resolve: Box<dyn FnMut(Dict<'a>) -> Option<U> + '_>,
) -> Option<U>
pub fn get_ext_g_state<U>( &self, name: Name<'_>, cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>, resolve: Box<dyn FnMut(Dict<'a>) -> Option<U> + '_>, ) -> Option<U>
Get an external graphics state by name.
Sourcepub fn get_color_space<U>(
&self,
name: Name<'_>,
cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>,
resolve: Box<dyn FnMut(Object<'a>) -> Option<U> + '_>,
) -> Option<U>
pub fn get_color_space<U>( &self, name: Name<'_>, cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>, resolve: Box<dyn FnMut(Object<'a>) -> Option<U> + '_>, ) -> Option<U>
Get a color space by name.
Sourcepub fn get_font<U>(
&self,
name: Name<'_>,
cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>,
resolve: Box<dyn FnMut(Dict<'a>) -> Option<U> + '_>,
) -> Option<U>
pub fn get_font<U>( &self, name: Name<'_>, cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>, resolve: Box<dyn FnMut(Dict<'a>) -> Option<U> + '_>, ) -> Option<U>
Get a font by name.
Sourcepub fn get_pattern<U>(
&self,
name: Name<'_>,
cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>,
resolve: Box<dyn FnMut(Object<'a>) -> Option<U> + '_>,
) -> Option<U>
pub fn get_pattern<U>( &self, name: Name<'_>, cache: Box<dyn FnMut(ObjRef) -> Option<U> + '_>, resolve: Box<dyn FnMut(Object<'a>) -> Option<U> + '_>, ) -> Option<U>
Get a pattern by name.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Resources<'a>
impl<'a> !RefUnwindSafe for Resources<'a>
impl<'a> Send for Resources<'a>
impl<'a> Sync for Resources<'a>
impl<'a> Unpin for Resources<'a>
impl<'a> !UnwindSafe for Resources<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more