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

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

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

Failures

  • ErrorKind::NotFound is returned when the given filename isn't found or there is no CueSheet within the file.
  • ErrorKind::InvalidData is returned when the data within the file isn't valid FLAC data.

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();