pub struct ParserFactory { /* private fields */ }Expand description
Factory for creating tool parsers based on model type.
Implementations§
Source§impl ParserFactory
impl ParserFactory
Sourcepub fn get_pooled(&self, model_id: &str) -> PooledParser
pub fn get_pooled(&self, model_id: &str) -> PooledParser
Get a pooled parser for the given model ID. Returns a shared instance that can be used concurrently. Falls back to passthrough parser if model is not recognized.
Sourcepub fn registry(&self) -> &ParserRegistry
pub fn registry(&self) -> &ParserRegistry
Get the internal registry for custom registration.
Sourcepub fn clear_pool(&self)
pub fn clear_pool(&self)
Clear the parser pool.
Sourcepub fn get_parser(&self, model_id: &str) -> Option<Arc<dyn ToolParser>>
pub fn get_parser(&self, model_id: &str) -> Option<Arc<dyn ToolParser>>
Get a non-pooled parser for the given model ID (creates a fresh instance each time). This is useful for benchmarks and testing where you want independent parser instances.
Sourcepub fn list_parsers(&self) -> Vec<String>
pub fn list_parsers(&self) -> Vec<String>
List all registered parsers (for compatibility with old API).
Trait Implementations§
Source§impl Clone for ParserFactory
impl Clone for ParserFactory
Source§fn clone(&self) -> ParserFactory
fn clone(&self) -> ParserFactory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParserFactory
impl !RefUnwindSafe for ParserFactory
impl Send for ParserFactory
impl Sync for ParserFactory
impl Unpin for ParserFactory
impl UnsafeUnpin for ParserFactory
impl !UnwindSafe for ParserFactory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more