Function flac::metadata::get_cue_sheet [] [src]

pub fn get_cue_sheet(filename: &str) -> Result<CueSheet, ErrorKind>

Reads and returns the CueSheet metadata block of the given FLAC file.

Failures

  • ErrorKind::NotFound is returned when the there is no CueSheet within the file.
  • ErrorKind::IO(io::ErrorKind::NotFound) is returned when the given filename isn't found.
  • ErrorKind::IO(io::ErrorKind::InvalidData) is returned when the data within the file isn't valid FLAC data.
  • Several different parser specific errors that are structured as ErrorKind::<parser_name>Parser.

Examples

Handling errors might look something like this:

use flac::metadata;

match metadata::get_cue_sheet("path/to/file.flac") {
  Ok(cue_sheet) => {
    // Use the cue_sheet variable...
  }
  Err(error)    => println!("{:?}", error),
}

Or just ignore the errors

use flac::metadata;

let cue_sheet = metadata::get_cue_sheet("path/to/file.flac").unwrap();