Crates.io | xrust-net |
lib.rs | xrust-net |
version | 0.1.0 |
created_at | 2025-08-29 06:55:47.807745+00 |
updated_at | 2025-08-29 06:55:47.807745+00 |
description | Support for Xrust |
homepage | |
repository | https://gitlab.gnome.org/balls/xrust-net |
max_upload_size | |
id | 1815461 |
size | 69,254 |
Networking support for the χrust crate.
This crate provides a library with a function to resolve a URL to the content of the resource. In other words, it fetches a URL and returns a String containing the document. At a minimum it must support file: and http(s): schemes.
The intended use for this function is in the import and include methods for χrust's xslt module. One of the from_document function's argument is a closure. Use the resolve function in that closure, for example:
from_document(
style,
Some(Base URI),
|s| make_document(s),
|url| resolve(url),
)
The resolve function may also be used for external entities when parsing XML documents.
See the test in resolver.rs for a complete example.