pub struct ParserRegistry { /* private fields */ }Expand description
Registry for keybind parsers supporting multiple formats
Implementations§
Source§impl ParserRegistry
impl ParserRegistry
Sourcepub fn register(
&mut self,
format: impl Into<String>,
parser: Arc<dyn KeybindParser>,
)
pub fn register( &mut self, format: impl Into<String>, parser: Arc<dyn KeybindParser>, )
Register a custom parser for a format
Sourcepub fn get_parser(&self, format: &str) -> Option<Arc<dyn KeybindParser>>
pub fn get_parser(&self, format: &str) -> Option<Arc<dyn KeybindParser>>
Get a parser for a specific format
Sourcepub fn parse_auto(&self, content: &str) -> Result<Vec<Keybind>, ParseError>
pub fn parse_auto(&self, content: &str) -> Result<Vec<Keybind>, ParseError>
Auto-detect format and parse content
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParserRegistry
impl !RefUnwindSafe for ParserRegistry
impl Send for ParserRegistry
impl Sync for ParserRegistry
impl Unpin for ParserRegistry
impl !UnwindSafe for ParserRegistry
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