pub trait Parser:
Send
+ Sync
+ Debug
+ Display {
// Required methods
fn supported_format_list(&self) -> Vec<String>;
fn try_parse(&self, bytes: &[u8]) -> Result<Input>;
fn is_format_supported(&self, bytes: &[u8]) -> Option<bool>;
// Provided method
fn parse(&self, bytes: &[u8]) -> Result<Input, Error> { ... }
}Expand description
A trait to parse configuration contents.
Required Methods§
Sourcefn supported_format_list(&self) -> Vec<String>
fn supported_format_list(&self) -> Vec<String>
Supported format list (e.g. “yml”)
Sourcefn is_format_supported(&self, bytes: &[u8]) -> Option<bool>
fn is_format_supported(&self, bytes: &[u8]) -> Option<bool>
Checks if provided byte slice is ok for future parsing. (e.g. is it YAML at all or not)