pub fn cards() -> io::Result<Box<Iterator<Item=PathBuf>>> {
        // Read this hardcoded directory. (Normal place for Linux)
        Ok(Box::new({
            try!(fs::read_dir("/dev/dri"))
            // Filter out io erros
                .filter_map(Result::ok)
            // Extract the pathname
                .map(|e| e.path())
            // Filter out files that aren't cards
                .filter(|p| p.file_name()
                        .and_then(|f| f.to_str())
                        .map(|f| f.starts_with("card"))
                        .unwrap_or(false))
        }) as Box<_>)
    }
/// List the cards found at the "Usual place" (/dev/dri).
///
/// This is mostly for convienience. It's simply iterating over: /dev/dri/card*
///
/// A more nuanced solution might need to be implemented.
/// Such as support control and render nodes.
List the cards found at the "Usual place" (/dev/dri).
This is mostly for convienience. It's simply iterating over: /dev/dri/card

A more nuanced solution might need to be implemented.
Such as support control and render nodes.
List the cards found at the " Usual place " ( / dev / dri ) . This is mostly for convienience . It ' s simply iterating over : / dev / dri / card A more nuanced solution might need to be implemented . Such as support control and render nodes .
pub fn cards() -> io::Result<Box<Iterator<Item=PathBuf>>> {
        // Read this hardcoded directory. (Normal place for Linux)
        Ok(Box::new({
            try!(fs::read_dir("/dev/dri"))
            // Filter out io erros
                .filter_map(Result::ok)
            // Extract the pathname
                .map(|e| e.path())
            // Filter out files that aren't cards
                .filter(|p| p.file_name()
                        .and_then(|f| f.to_str())
                        .map(|f| f.starts_with("card"))
                        .unwrap_or(false))
        }) as Box<_>)
    }
pub fn cards ( ) -> io :: Result < Box < Iterator < Item = PathBuf > > > { // Read this hardcoded directory. (Normal place for Linux) Ok ( Box :: new ( { try ! ( fs read_dir ( " " ) ) // Filter out io erros . filter_map ( Result :: ok ) // Extract the pathname . map ( | e | e . path ( ) ) // Filter out files that aren't cards . filter ( | p | p . file_name ( ) . and_then ( | f | f . to_str ( ) ) . map ( | f | f . starts_with ( " " ) ) . unwrap_or ( false ) ) } ) as Box < _ > ) }
List the cards found at the "Usual place" (/dev/dri).
List the cards found at the " Usual place " ( / dev / dri ) .