pub struct FilesystemResolver { /* private fields */ }Expand description
Recommended default resolver: loads from filesystem only, refuses anything outside the configured allowed-root directories, optionally consults an OASIS catalog first.
The allowed-roots list is the security boundary. Empty list
= nothing will resolve. Pass specific directories like
/usr/share/xml; never pass /.
Implementations§
Source§impl FilesystemResolver
impl FilesystemResolver
Sourcepub fn new(allowed_roots: Vec<PathBuf>) -> FilesystemResolver
pub fn new(allowed_roots: Vec<PathBuf>) -> FilesystemResolver
Construct a resolver allowed to read from the given directories. Files outside these directories will be refused even if the catalog or the system_id points at them.
Sourcepub fn with_catalog(self, catalog: Catalog) -> FilesystemResolver
pub fn with_catalog(self, catalog: Catalog) -> FilesystemResolver
Builder: consult this catalog before falling back to the
raw filesystem. PUBLIC IDs in the catalog map to local
file:// URIs.
Trait Implementations§
Source§impl Clone for FilesystemResolver
impl Clone for FilesystemResolver
Source§fn clone(&self) -> FilesystemResolver
fn clone(&self) -> FilesystemResolver
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 FilesystemResolver
impl Debug for FilesystemResolver
Auto Trait Implementations§
impl Freeze for FilesystemResolver
impl RefUnwindSafe for FilesystemResolver
impl Send for FilesystemResolver
impl Sync for FilesystemResolver
impl Unpin for FilesystemResolver
impl UnsafeUnpin for FilesystemResolver
impl UnwindSafe for FilesystemResolver
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