pub struct InMemoryLoader { /* private fields */ }Expand description
In-memory loader keyed by href. Useful for tests and for embedding the ISO Schematron pipeline (where the skeleton stylesheets are bundled into the binary rather than loaded from disk).
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryLoader
impl Clone for InMemoryLoader
Source§fn clone(&self) -> InMemoryLoader
fn clone(&self) -> InMemoryLoader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryLoader
impl Debug for InMemoryLoader
Source§impl Default for InMemoryLoader
impl Default for InMemoryLoader
Source§fn default() -> InMemoryLoader
fn default() -> InMemoryLoader
Returns the “default value” for a type. Read more
Source§impl Loader for InMemoryLoader
impl Loader for InMemoryLoader
Source§fn load(&self, href: &str, _base: Option<&str>) -> Result<String, XsltError>
fn load(&self, href: &str, _base: Option<&str>) -> Result<String, XsltError>
Load
href’s contents. Returns the raw source as a UTF-8
string. Implementations should resolve href against
base when href is relative.Source§fn load_parsed(
&self,
href: &str,
base: Option<&str>,
) -> Result<Arc<Document>, XsltError>
fn load_parsed( &self, href: &str, base: Option<&str>, ) -> Result<Arc<Document>, XsltError>
Load
href’s contents and return them as a parsed
sup_xml_tree::dom::Document. Default implementation
calls Self::load and parses fresh each time; loaders
that expect repeated lookups for the same URI (filesystem,
in-memory) should override to cache the parse result
internally so the runtime doc() path doesn’t re-parse
the same XML thousands of times across an apply sweep. Read moreSource§fn resolve(&self, href: &str, base: Option<&str>) -> Result<String, XsltError>
fn resolve(&self, href: &str, base: Option<&str>) -> Result<String, XsltError>
Compute the base URI to use for files imported FROM the
resource at
href. Default: returns href itself
(used as the base for the next level of resolution).Source§fn enumerate(&self, base: Option<&str>) -> Vec<String>
fn enumerate(&self, base: Option<&str>) -> Vec<String>
Enumerate every URI the loader can serve. Returned as
hrefs that, when passed to
Self::load with the same
base, succeed. Called by the XSLT runtime when the
stylesheet uses a dynamic document() / doc() URI
(computed via concat / variables / @attr) — every
enumerated URI is speculatively pre-loaded so that the
runtime call can resolve against the pre-loaded map. Read moreAuto Trait Implementations§
impl Freeze for InMemoryLoader
impl RefUnwindSafe for InMemoryLoader
impl Send for InMemoryLoader
impl Sync for InMemoryLoader
impl Unpin for InMemoryLoader
impl UnsafeUnpin for InMemoryLoader
impl UnwindSafe for InMemoryLoader
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