pub struct StreamRegistry { /* private fields */ }Expand description
Registry of available stream parsers.
Implementations§
Source§impl StreamRegistry
impl StreamRegistry
pub fn new() -> Self
Sourcepub fn register<P: StreamParser + 'static>(&mut self, parser: P)
pub fn register<P: StreamParser + 'static>(&mut self, parser: P)
Register a stream parser.
Sourcepub fn find_parser(&self, context: &StreamContext) -> Option<&dyn StreamParser>
pub fn find_parser(&self, context: &StreamContext) -> Option<&dyn StreamParser>
Find a parser that can handle this stream.
Sourcepub fn get_parser(&self, name: &str) -> Option<&dyn StreamParser>
pub fn get_parser(&self, name: &str) -> Option<&dyn StreamParser>
Get a parser by name.
Sourcepub fn parser_names(&self) -> Vec<&'static str>
pub fn parser_names(&self) -> Vec<&'static str>
Get all registered parser names.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamRegistry
impl !RefUnwindSafe for StreamRegistry
impl Send for StreamRegistry
impl Sync for StreamRegistry
impl Unpin for StreamRegistry
impl !UnwindSafe for StreamRegistry
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