Skip to main content

asterust_junos/system/services/
xnm_clear_text.rs

1//! `xnm-clear-text`
2//! `system { services { xnm-clear-text { ... } } }`.
3//!
4//! # See also
5//!
6//! - [xnm-clear-text](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/xnm-clear-text-edit-system.html)
7
8use crate::arg_of;
9use asterust::config::ConfigLine;
10
11/// The `xnm-clear-text` block.
12#[derive(Clone, Debug, PartialEq, Eq)]
13#[non_exhaustive]
14pub struct XnmClearText {
15    pub connection_limit: Option<String>,
16    pub rate_limit: Option<String>,
17}
18
19pub(super) fn parse_xnm_clear_text(xnm: &ConfigLine) -> XnmClearText {
20    XnmClearText {
21        connection_limit: arg_of(xnm, "connection-limit").map(str::to_string),
22        rate_limit: arg_of(xnm, "rate-limit").map(str::to_string),
23    }
24}