asterust-junos 0.5.0

Typed Juniper JunOS config views (interfaces, OSPF, BGP, IS-IS, routing instances, policy options, firewall filters, system) extracted from an asterust config tree.
Documentation
//! `monitoring`
//! `services { monitoring { ... } }`.
//!
//! Junos OS Evolved only. Only `twamp` is read.
//!
//! # See also
//!
//! - [twamp (Junos OS Evolved)](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/twamp-edit-services.html)

pub mod twamp;

pub use twamp::Twamp;

use crate::child_block;
use asterust::config::ConfigLine;
use twamp::parse_twamp;

/// The `services monitoring` configuration of Junos OS Evolved.
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct Monitoring {
    pub twamp: Option<Twamp>,
}

pub(super) fn parse_monitoring(line: &ConfigLine) -> Monitoring {
    Monitoring {
        twamp: child_block(line, "twamp").map(parse_twamp),
    }
}