pub struct ResolverChain { /* private fields */ }Expand description
An asset resolver that chains sub-resolvers together to attempt to resolve a path using multiple ordered methods.
Implementations§
Source§impl ResolverChain
impl ResolverChain
Trait Implementations§
Source§impl AssetResolver for ResolverChain
impl AssetResolver for ResolverChain
Source§fn resolve(&self, path: &str) -> Option<PathBuf>
fn resolve(&self, path: &str) -> Option<PathBuf>
Attempt to resolve a path using the resolvers in the chain.
§Example
let resolver = ResolverChain::new(vec![
Box::new(NullResolver),
Box::new(DefaultResolver),
]);
let path = resolver.resolve("/home/user/assets/test.png").unwrap();
assert_eq!(path.to_str().unwrap(), "/home/user/assets/test.png");Auto Trait Implementations§
impl Freeze for ResolverChain
impl !RefUnwindSafe for ResolverChain
impl !Send for ResolverChain
impl !Sync for ResolverChain
impl Unpin for ResolverChain
impl UnsafeUnpin for ResolverChain
impl !UnwindSafe for ResolverChain
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