pub trait ResourceResolver: Send + Sync {
// Required method
fn bytes(&self, locator: &str) -> Result<Arc<[u8]>, ExtensionError>;
// Provided method
fn fonts(&self) -> Vec<Arc<[u8]>> { ... }
}Expand description
Supplies bytes a source needs besides its own (sequence frames, SVG fonts and images).
Parsers may call it from other threads, hence Send + Sync.
Required Methods§
Sourcefn bytes(&self, locator: &str) -> Result<Arc<[u8]>, ExtensionError>
fn bytes(&self, locator: &str) -> Result<Arc<[u8]>, ExtensionError>
The bytes registered under locator.
§Errors
ExtensionError::MissingResource when none are registered.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".