pub struct Parser {}
Expand description
A generic parser for firewall configuration files.
This parser determines the correct parsing logic based on the specified platform.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse(
platform: &str,
document: &str,
) -> Result<Configuration, FireparseError>
pub fn parse( platform: &str, document: &str, ) -> Result<Configuration, FireparseError>
Parses a firewall configuration document based on the specified platform.
§Arguments
platform
- A string slice representing the firewall platform (e.g.,"pfsense"
).document
- A string slice containing the raw firewall configuration data.
§Returns
Ok(Configuration)
- If parsing is successful, returns aConfiguration
struct.Err(FireparseError)
- If the platform is unsupported or the document is invalid.
§Supported Platforms
"pfsense"
: UsesPfSenseParser
to process pfSense XML configurations.
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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