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(
platfom: Platform,
snapshot: Snapshot,
) -> Result<Configuration, FireparseError>
pub fn parse( platfom: Platform, snapshot: Snapshot, ) -> Result<Configuration, FireparseError>
Parses a firewall configuration snapshot based on the specified platform.
§Arguments
platform
- The firewall platform (e.g.,Platform::PfSense
orPlatform::OPNsense
).snapshot
- ASnapshot
representing the firewall configuration state.
§Returns
Ok(Configuration)
- If parsing is successful, returns aConfiguration
struct.Err(FireparseError)
- If the platform is unsupported or the snapshot is invalid.
§Supported Platforms
Platform::PfSense
: UsesPfSenseParser
to process pfSense configurations.Platform::OPNsense
: UsesOpnSenseParser
to process OPNsense 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