pub struct Parser { /* private fields */ }Expand description
Unified parser backed by the heuristic regex engine.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn new(config: ParserConfig) -> Result<Self>
pub fn new(config: ParserConfig) -> Result<Self>
Create a new parser with the given configuration.
Sourcepub fn parse(&self, input: &str) -> Result<ParseResult>
pub fn parse(&self, input: &str) -> Result<ParseResult>
Parse a filename using the configured mode.
§Arguments
input- The filename or torrent name to parse
§Returns
A ParseResult containing extracted metadata
§Examples
use zantetsu_core::parser::Parser;
let parser = Parser::default().unwrap();
let result = parser.parse("[SubsPlease] Jujutsu Kaisen - 24 (1080p) [A1B2C3D4].mkv").unwrap();
assert_eq!(result.title.as_deref(), Some("Jujutsu Kaisen"));
assert_eq!(result.group.as_deref(), Some("SubsPlease"));Sourcepub fn config(&self) -> &ParserConfig
pub fn config(&self) -> &ParserConfig
Get the parser configuration.
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more