pub struct ParserPool { /* private fields */ }Expand description
Thread-safe parser pool for reuse
Note: This is a simplified version that focuses on cache management. For a full implementation, consider parser state management.
Implementations§
Source§impl ParserPool
impl ParserPool
Sourcepub fn new(max_size: usize) -> Self
pub fn new(max_size: usize) -> Self
Create new parser pool
§Examples
use ruchy::performance_optimizations::ParserPool;
let pool = ParserPool::new(10);
assert_eq!(pool.capacity(), 10);Sourcepub fn create_parser<'a>(&self, input: &'a str) -> Parser<'a>
pub fn create_parser<'a>(&self, input: &'a str) -> Parser<'a>
Create a new parser (simplified implementation)
In a full implementation, this would manage a pool of reusable parsers
Sourcepub fn stats(&self) -> PoolStatsSummary
pub fn stats(&self) -> PoolStatsSummary
Get pool statistics
Auto Trait Implementations§
impl Freeze for ParserPool
impl RefUnwindSafe for ParserPool
impl Send for ParserPool
impl Sync for ParserPool
impl Unpin for ParserPool
impl UnwindSafe for ParserPool
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> 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