pub trait SchemaLoader:
Send
+ Sync
+ Debug {
// Required methods
fn load(&self, location: &str) -> SchemaResult<String>;
fn can_load(&self, location: &str) -> bool;
// Provided method
fn priority(&self) -> i32 { ... }
}Expand description
Trait for loading schema content from various sources.
Implementations can support file systems, HTTP, embedded resources, etc. The loader chain uses priority to determine which loader handles a request.
Required Methods§
Sourcefn load(&self, location: &str) -> SchemaResult<String>
fn load(&self, location: &str) -> SchemaResult<String>
Load schema content from the given location.
Returns the schema content as a string, or an error if loading fails.
Sourcefn can_load(&self, location: &str) -> bool
fn can_load(&self, location: &str) -> bool
Check if this loader can handle the given location.
Used by LoaderChain to find an appropriate loader.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".