pub trait ResourceResolver {
// Required method
fn resolve(&self, uri: &str) -> Result<Vec<u8>, GltfError>;
// Provided method
fn resolve_with_limit(
&self,
uri: &str,
max_bytes: Option<usize>,
) -> Result<Vec<u8>, GltfError> { ... }
}Available on crate feature
gltf-container only.Expand description
Synchronous resolver for non-data resource URIs.
Required Methods§
Provided Methods§
Sourcefn resolve_with_limit(
&self,
uri: &str,
max_bytes: Option<usize>,
) -> Result<Vec<u8>, GltfError>
fn resolve_with_limit( &self, uri: &str, max_bytes: Option<usize>, ) -> Result<Vec<u8>, GltfError>
Resolve with a decoded-byte limit when the implementation can preflight it. The default preserves compatibility for custom resolvers and checks their returned bytes; filesystem resolvers override this to check file metadata before allocating.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".