fn resolve_virtual_files<'a>(
        &'a self,
        mount_point: PathBuf,
    ) -> Box<dyn Iterator<Item = VirtualFile> + 'a> {
        match self {
            MountSource::CopyFromPath(p) => {
                if p.is_dir() {
                    let iter = walkdir(p)
                        .map(move |e| create_virtual_file_from_dir_entry(e, &mount_point, p));
                    Box::new(iter)
                } else {
                    let wish = VirtualFile::file(mount_point, File::open(p).unwrap());
                    Box::new(iter::once(wish))
                }
            }
            MountSource::CustomDir(_) => Box::new(iter::once(VirtualFile::dir(mount_point))),
            MountSource::TextContent(text) => {
                let wish = VirtualFile::file(mount_point, io::Cursor::new(text.clone()));
                Box::new(iter::once(wish))
            }
            MountSource::FileSet(set) => {
                let base_dir = set.base_dir();
                let iter = walkdir(base_dir)
                    .filter(move |e| set.matches(e.path()))
                    .map(move |e| create_virtual_file_from_dir_entry(e, &mount_point, base_dir));
                Box::new(iter)
            }
        }
    }
/// Returns an iterator that expands just this mount source, depending on its type.
Returns an iterator that expands just this mount source, depending on its type.
Returns an iterator that expands just this mount source depending on its type .
fn resolve_virtual_files<'a>(
        &'a self,
        mount_point: PathBuf,
    ) -> Box<dyn Iterator<Item = VirtualFile> + 'a> {
        match self {
            MountSource::CopyFromPath(p) => {
                if p.is_dir() {
                    let iter = walkdir(p)
                        .map(move |e| create_virtual_file_from_dir_entry(e, &mount_point, p));
                    Box::new(iter)
                } else {
                    let wish = VirtualFile::file(mount_point, File::open(p).unwrap());
                    Box::new(iter::once(wish))
                }
            }
            MountSource::CustomDir(_) => Box::new(iter::once(VirtualFile::dir(mount_point))),
            MountSource::TextContent(text) => {
                let wish = VirtualFile::file(mount_point, io::Cursor::new(text.clone()));
                Box::new(iter::once(wish))
            }
            MountSource::FileSet(set) => {
                let base_dir = set.base_dir();
                let iter = walkdir(base_dir)
                    .filter(move |e| set.matches(e.path()))
                    .map(move |e| create_virtual_file_from_dir_entry(e, &mount_point, base_dir));
                Box::new(iter)
            }
        }
    }
fn resolve_virtual_files < ' a > ( & ' a self , mount_point : PathBuf , ) -> Box < dyn Iterator < Item = VirtualFile > + ' a > { match self { MountSource :: CopyFromPath ( p ) => { if p . is_dir ( ) { let iter = walkdir ( p ) . map ( move | e | create_virtual_file_from_dir_entry ( e , & mount_point , p ) ) ; Box :: new ( iter ) } else { let wish = VirtualFile :: file ( mount_point , File :: open ( p ) . unwrap ( ) ) ; Box :: new ( iter :: once ( wish ) ) } } MountSource :: CustomDir ( _ ) => Box :: new ( iter :: once ( VirtualFile :: dir ( mount_point ) ) ) , MountSource :: TextContent ( text ) => { let wish = VirtualFile :: file ( mount_point , io :: Cursor :: new ( text . clone ( ) ) ) ; Box :: new ( iter :: once ( wish ) ) } MountSource :: FileSet ( set ) => { let base_dir = set . base_dir ( ) ; let iter = walkdir ( base_dir ) . filter ( move | e | set . matches ( e . path ( ) ) ) . map ( move | e | create_virtual_file_from_dir_entry ( e , & mount_point , base_dir ) ) ; Box :: new ( iter ) } } }
Returns an iterator that expands just this mount source, depending on its type.
Returns an iterator that expands just this mount source depending on its type .
&'a self
mount_point
PathBuf