pub struct SchemaOptions {
pub base_uri: Option<String>,
pub resolver: SharedResolver,
pub max_include_depth: usize,
pub allow_unknown_query_binding: bool,
}Expand description
How to load a schema.
§Examples
use std::sync::Arc;
use schematron::schema::{MemoryResolver, SchemaOptions};
let options = SchemaOptions::new()
.with_resolver(Arc::new(MemoryResolver::new().with("common.sch", "<p/>")))
.with_max_include_depth(8);
assert_eq!(options.max_include_depth, 8);Fields§
§base_uri: Option<String>The base URI that relative include hrefs resolve against.
resolver: SharedResolverHow include and extends href fetch their targets.
max_include_depth: usizeHow deeply includes may nest before it is treated as a runaway.
allow_unknown_query_binding: boolCompile a schema whose queryBinding this crate does not implement.
Off by default: running an xslt2 schema through an XPath 1.0 engine
gives wrong answers quietly. Turn it on for the common case of a
schema that declares xslt2 but only uses XPath 1.0 constructs — any
construct that really is XPath 2.0 will still fail to compile, with a
message naming it.
Implementations§
Source§impl SchemaOptions
impl SchemaOptions
Sourcepub fn with_base_uri(self, uri: impl Into<String>) -> Self
pub fn with_base_uri(self, uri: impl Into<String>) -> Self
Sets the base URI for relative includes.
Sourcepub fn with_resolver(self, resolver: SharedResolver) -> Self
pub fn with_resolver(self, resolver: SharedResolver) -> Self
Sets the resolver.
Sourcepub fn with_max_include_depth(self, depth: usize) -> Self
pub fn with_max_include_depth(self, depth: usize) -> Self
Sets the include depth limit.
Sourcepub fn with_allow_unknown_query_binding(self, allow: bool) -> Self
pub fn with_allow_unknown_query_binding(self, allow: bool) -> Self
Allows an unsupported queryBinding to compile anyway.
Trait Implementations§
Source§impl Clone for SchemaOptions
impl Clone for SchemaOptions
Source§fn clone(&self) -> SchemaOptions
fn clone(&self) -> SchemaOptions
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 SchemaOptions
impl Debug for SchemaOptions
Auto Trait Implementations§
impl !RefUnwindSafe for SchemaOptions
impl !UnwindSafe for SchemaOptions
impl Freeze for SchemaOptions
impl Send for SchemaOptions
impl Sync for SchemaOptions
impl Unpin for SchemaOptions
impl UnsafeUnpin for SchemaOptions
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