pub enum DiscoverIndexPathResolver {
Remap {
from: PathBuf,
to: PathBuf,
},
Custom {
f: Box<dyn Fn(&Path) -> Option<PathBuf>>,
},
}Expand description
A resolver for test index data file paths.
§Examples
let resolver = DiscoverIndexPathResolver::Remap {from: "foo".into(), to: "bar".into()};
assert_eq!(resolver.resolve(Path::new("foo/bar/baz")), Some(PathBuf::from("bar/bar/baz")));
assert_eq!(resolver.resolve(Path::new("bar/baz")), None);Variants§
Remap
Remaps the index path from the given from path to the given to path.
Fields
Custom
A custom remapping function.
Implementations§
Auto Trait Implementations§
impl Freeze for DiscoverIndexPathResolver
impl !RefUnwindSafe for DiscoverIndexPathResolver
impl !Send for DiscoverIndexPathResolver
impl !Sync for DiscoverIndexPathResolver
impl Unpin for DiscoverIndexPathResolver
impl !UnwindSafe for DiscoverIndexPathResolver
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