mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 06:02:32 +00:00
probe: Document how to use ParsingMode
This commit is contained in:
parent
f8267641a9
commit
bf80fec0dd
1 changed files with 14 additions and 0 deletions
14
src/probe.rs
14
src/probe.rs
|
@ -115,6 +115,20 @@ impl ParseOptions {
|
|||
}
|
||||
|
||||
/// The parsing strictness mode
|
||||
///
|
||||
/// This can be set with [`Probe::options`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// use lofty::{ParseOptions, ParsingMode, Probe};
|
||||
///
|
||||
/// # fn main() -> lofty::Result<()> {
|
||||
/// // We only want to read spec-compliant inputs
|
||||
/// let parsing_options = ParseOptions::new().parsing_mode(ParsingMode::Strict);
|
||||
/// let tagged_file = Probe::open("foo.mp3")?.options(parsing_options).read()?;
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Default)]
|
||||
#[non_exhaustive]
|
||||
pub enum ParsingMode {
|
||||
|
|
Loading…
Reference in a new issue