Struct rxml::AsyncDriver
source · [−]pub struct AsyncDriver<T, P: Parse> { /* private fields */ }Expand description
Asynchronous driver for parsers
This is a generic asynchronous driver for objects implementing the
Parse trait.
In general, it is advised to use the AsyncParser alias which
specializes this struct for use with the default Parser.
Implementations
sourceimpl<T: AsyncBufRead, P: Parse + Default> AsyncDriver<T, P>
impl<T: AsyncBufRead, P: Parse + Default> AsyncDriver<T, P>
sourcepub fn new(inner: T) -> Self
pub fn new(inner: T) -> Self
Create a new parser with default options, wrapping the given reader.
sourcepub fn with_options(inner: T, options: LexerOptions) -> Self
pub fn with_options(inner: T, options: LexerOptions) -> Self
Create a new parser while configuring the lexer with the given options.
sourceimpl<T: AsyncBufRead, P: Parse> AsyncDriver<T, P>
impl<T: AsyncBufRead, P: Parse> AsyncDriver<T, P>
sourcepub fn wrap(inner: T, lexer: Lexer, parser: P) -> Self
pub fn wrap(inner: T, lexer: Lexer, parser: P) -> Self
Create a fully customized parser from a lexer and a parser component.
sourcepub fn into_inner(self) -> (T, Lexer, P)
pub fn into_inner(self) -> (T, Lexer, P)
Decompose the AsyncDriver into its parts
sourcepub fn get_inner_mut(&mut self) -> &mut T
pub fn get_inner_mut(&mut self) -> &mut T
Access the inner AsyncBufRead, mutably
sourcepub fn get_lexer_mut(&mut self) -> &mut Lexer
pub fn get_lexer_mut(&mut self) -> &mut Lexer
Access the lexer, mutably
sourcepub fn get_parser(&self) -> &P
pub fn get_parser(&self) -> &P
Access the parser
sourcepub fn get_parser_mut(&mut self) -> &mut P
pub fn get_parser_mut(&mut self) -> &mut P
Access the parser, mutably
sourcepub fn release_temporaries(&mut self)
pub fn release_temporaries(&mut self)
Release temporary buffers and other ephemeral allocations.
This is sensible to call when it is expected that no more data will be processed by the parser for a while and the memory is better used elsewhere.
Trait Implementations
sourceimpl<T: AsyncBufRead, P: Parse> AsyncEventRead for AsyncDriver<T, P>
impl<T: AsyncBufRead, P: Parse> AsyncEventRead for AsyncDriver<T, P>
sourceimpl<T: AsyncBufRead, P: Parse + Default> Stream for AsyncDriver<T, P>
impl<T: AsyncBufRead, P: Parse + Default> Stream for AsyncDriver<T, P>
impl<'__pin, T, P: Parse> Unpin for AsyncDriver<T, P> where
__Origin<'__pin, T, P>: Unpin,
Auto Trait Implementations
impl<T, P> RefUnwindSafe for AsyncDriver<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for AsyncDriver<T, P> where
P: Send,
T: Send,
impl<T, P> Sync for AsyncDriver<T, P> where
P: Sync,
T: Sync,
impl<T, P> UnwindSafe for AsyncDriver<T, P> where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more