|
| 1 | +pub use aud_io::config::ParsingMode; |
| 2 | + |
1 | 3 | /// Options to control how Lofty parses a file |
2 | 4 | #[derive(Copy, Clone, Debug, Eq, PartialEq)] |
3 | 5 | #[non_exhaustive] |
@@ -163,56 +165,3 @@ impl ParseOptions { |
163 | 165 | *self |
164 | 166 | } |
165 | 167 | } |
166 | | - |
167 | | -/// The parsing strictness mode |
168 | | -/// |
169 | | -/// This can be set with [`Probe::options`](crate::probe::Probe). |
170 | | -/// |
171 | | -/// # Examples |
172 | | -/// |
173 | | -/// ```rust,no_run |
174 | | -/// use lofty::config::{ParseOptions, ParsingMode}; |
175 | | -/// use lofty::probe::Probe; |
176 | | -/// |
177 | | -/// # fn main() -> lofty::error::Result<()> { |
178 | | -/// // We only want to read spec-compliant inputs |
179 | | -/// let parsing_options = ParseOptions::new().parsing_mode(ParsingMode::Strict); |
180 | | -/// let tagged_file = Probe::open("foo.mp3")?.options(parsing_options).read()?; |
181 | | -/// # Ok(()) } |
182 | | -/// ``` |
183 | | -#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Default)] |
184 | | -#[non_exhaustive] |
185 | | -pub enum ParsingMode { |
186 | | - /// Will eagerly error on invalid input |
187 | | - /// |
188 | | - /// This mode will eagerly error on any non spec-compliant input. |
189 | | - /// |
190 | | - /// ## Examples of behavior |
191 | | - /// |
192 | | - /// * Unable to decode text - The parser will error and the entire input is discarded |
193 | | - /// * Unable to determine the sample rate - The parser will error and the entire input is discarded |
194 | | - Strict, |
195 | | - /// Default mode, less eager to error on recoverably malformed input |
196 | | - /// |
197 | | - /// This mode will attempt to fill in any holes where possible in otherwise valid, spec-compliant input. |
198 | | - /// |
199 | | - /// NOTE: A readable input does *not* necessarily make it writeable. |
200 | | - /// |
201 | | - /// ## Examples of behavior |
202 | | - /// |
203 | | - /// * Unable to decode text - If valid otherwise, the field will be replaced by an empty string and the parser moves on |
204 | | - /// * Unable to determine the sample rate - The sample rate will be 0 |
205 | | - #[default] |
206 | | - BestAttempt, |
207 | | - /// Least eager to error, may produce invalid/partial output |
208 | | - /// |
209 | | - /// This mode will discard any invalid fields, and ignore the majority of non-fatal errors. |
210 | | - /// |
211 | | - /// If the input is malformed, the resulting tags may be incomplete, and the properties zeroed. |
212 | | - /// |
213 | | - /// ## Examples of behavior |
214 | | - /// |
215 | | - /// * Unable to decode text - The entire item is discarded and the parser moves on |
216 | | - /// * Unable to determine the sample rate - The sample rate will be 0 |
217 | | - Relaxed, |
218 | | -} |
0 commit comments