pub trait Host {
// Required methods
fn variable(&self, id: VariableId) -> Result<Rc<[Item]>>;
fn call_function(
&self,
id: FunctionId,
args: Vec<Argument>,
dc: &DynamicContext<'_>,
) -> Result<Vec<Item>>;
fn document(&self, uri: &str, base: Option<&str>) -> Result<Node>;
fn system_property(&self, name: &QName) -> String;
}Expand description
What the host (the XSLT layer) provides at evaluation. The compiler only lets through references to variables and functions the static context declared, so a host is only asked for those.
Required Methods§
Sourcefn call_function(
&self,
id: FunctionId,
args: Vec<Argument>,
dc: &DynamicContext<'_>,
) -> Result<Vec<Item>>
fn call_function( &self, id: FunctionId, args: Vec<Argument>, dc: &DynamicContext<'_>, ) -> Result<Vec<Item>>
Calls a host function, from an evaluation in the dynamic context dc. Its
arguments are evaluated or not yet: the host computes each one when it needs it
(Argument::evaluate, with dc), as Saxon evaluates the arguments of a
stylesheet function lazily.
§Errors
Whatever the function raises.
Sourcefn document(&self, uri: &str, base: Option<&str>) -> Result<Node>
fn document(&self, uri: &str, base: Option<&str>) -> Result<Node>
document(): the document node of the resource at uri, resolved against base
(the base URI of the node the URI came from, None for the static base URI). The
same URI must give the same document node, parsed with
Document::parse_loaded
so that fn:document-uri gives its absolute URI, as in Saxon.
§Errors
The resource cannot be retrieved or parsed.
Sourcefn system_property(&self, name: &QName) -> String
fn system_property(&self, name: &QName) -> String
system-property(): the value of the property (the empty string for an unknown
one).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".