pub struct ResolverHelper<F1, F2>(pub F1, pub F2)
where
F1: FnMut(Path, PathBuf) -> Result<Option<File>, Error>,
F2: FnMut(Meta) -> Result<bool, UserError>;Expand description
Helper struct to define Resolver implementations using closures.
Tuple Fields§
§0: F1§1: F2Trait Implementations§
Source§impl<F1, F2> Resolver for ResolverHelper<F1, F2>
impl<F1, F2> Resolver for ResolverHelper<F1, F2>
Source§fn resolve(
&mut self,
module_name: Path,
path_relative_to_crate_root: PathBuf,
) -> Result<Option<File>, Error>
fn resolve( &mut self, module_name: Path, path_relative_to_crate_root: PathBuf, ) -> Result<Option<File>, Error>
Called each time a non-inline module is encountered that needs to be expanded.
module_name is full path from the specified file root to the module being expanded,
to use for error messages. Read moreSource§fn check_cfg(&mut self, cfg: Meta) -> Result<bool, UserError>
fn check_cfg(&mut self, cfg: Meta) -> Result<bool, UserError>
When
#[cfg(mymeta)] mod ...; or #[cfg_attr(mymeta,path=...)] is encountered, this function is called
and you should provide answer whether this cfg should be considered true or false.Source§fn allow_duplicate_modules_and_convert_cfg(&mut self) -> bool
fn allow_duplicate_modules_and_convert_cfg(&mut self) -> bool
Include all the modules, possibly duplicating them.
#[cfg_attr(...,path)] mod ...; are converted to #[cfg(...)] mod .. {} Read moreAuto Trait Implementations§
impl<F1, F2> Freeze for ResolverHelper<F1, F2>
impl<F1, F2> RefUnwindSafe for ResolverHelper<F1, F2>where
F1: RefUnwindSafe,
F2: RefUnwindSafe,
impl<F1, F2> Send for ResolverHelper<F1, F2>
impl<F1, F2> Sync for ResolverHelper<F1, F2>
impl<F1, F2> Unpin for ResolverHelper<F1, F2>
impl<F1, F2> UnwindSafe for ResolverHelper<F1, F2>where
F1: UnwindSafe,
F2: UnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more