pub fn lookup<T>(
        &mut self,
        tag: &Tag,
        global_options: &GlobalOptions,
    ) -> AppResult<Vec<ChildData>>
    where
        Self: Lookup<T>,
    {
        // open target file
        let file = File::open(&self.id.canon_path)
            .map_err(|e| context!(e, "unable to open file:{:?}", &self.id.canon_path))?;

        // if file is compressed, we need to call a specific reader
        // create a specific reader for each compression scheme
        match self.id.compression {
            CompressionScheme::Gzip => {
                let decoder = GzDecoder::new(file);
                let reader = BufReader::new(decoder);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
            CompressionScheme::Bzip2 => {
                let decoder = BzDecoder::new(file);
                let reader = BufReader::new(decoder);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
            CompressionScheme::Xz => {
                let decoder = XzDecoder::new(file);
                let reader = BufReader::new(decoder);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
            CompressionScheme::Uncompressed => {
                let reader = BufReader::new(file);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
        }
    }
///Just a wrapper function for a file.
Just a wrapper function for a file.
Just a wrapper function for a file .
pub fn lookup<T>(
        &mut self,
        tag: &Tag,
        global_options: &GlobalOptions,
    ) -> AppResult<Vec<ChildData>>
    where
        Self: Lookup<T>,
    {
        // open target file
        let file = File::open(&self.id.canon_path)
            .map_err(|e| context!(e, "unable to open file:{:?}", &self.id.canon_path))?;
        // if file is compressed, we need to call a specific reader
        // create a specific reader for each compression scheme
        match self.id.compression {
            CompressionScheme::Gzip => {
                let decoder = GzDecoder::new(file);
                let reader = BufReader::new(decoder);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
            CompressionScheme::Bzip2 => {
                let decoder = BzDecoder::new(file);
                let reader = BufReader::new(decoder);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
            CompressionScheme::Xz => {
                let decoder = XzDecoder::new(file);
                let reader = BufReader::new(decoder);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
            CompressionScheme::Uncompressed => {
                let reader = BufReader::new(file);
                //self.lookup_from_reader(reader, wrapper)
                Lookup::<T>::reader(self, reader, tag, global_options)
            }
        }
    }
pub fn lookup < T > ( & mut self , tag : & Tag , global_options : & GlobalOptions , ) -> AppResult < Vec < ChildData > > where Self : Lookup < T > , { // open target file let file = File :: open ( & self . id . canon_path ) . map_err ( | e | context ! ( e " " self id canon_path ) ) ? ; // if file is compressed, we need to call a specific reader // create a specific reader for each compression scheme match self . id . compression { CompressionScheme :: Gzip => { let decoder = GzDecoder :: new ( file ) ; let reader = BufReader :: new ( decoder ) ; //self.lookup_from_reader(reader, wrapper) Lookup :: < T > :: reader ( self , reader , tag , global_options ) } CompressionScheme :: Bzip2 => { let decoder = BzDecoder :: new ( file ) ; let reader = BufReader :: new ( decoder ) ; //self.lookup_from_reader(reader, wrapper) Lookup :: < T > :: reader ( self , reader , tag , global_options ) } CompressionScheme :: Xz => { let decoder = XzDecoder :: new ( file ) ; let reader = BufReader :: new ( decoder ) ; //self.lookup_from_reader(reader, wrapper) Lookup :: < T > :: reader ( self , reader , tag , global_options ) } CompressionScheme :: Uncompressed => { let reader = BufReader :: new ( file ) ; //self.lookup_from_reader(reader, wrapper) Lookup :: < T > :: reader ( self , reader , tag , global_options ) } } }
Just a wrapper function for a file.
Just a wrapper function for a file .
&mut self
tag
&Tag
global_options
&GlobalOptions
&mut self
tag
&Tag
global_options
&GlobalOptions