asterust_junos/interfaces/es_options.rs
1//! `es-options`
2//! `interfaces { <name> { es-options { backup-interface <name>; } } }`.
3//!
4//! # See also
5//!
6//! - [es-options](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/es-options-edit-interfaces.html)
7//! - [backup-interface](https://networkingdocs.hpe.com/documentation/us/en/software/junos/cli-reference/topics/ref/statement/backup-interface-edit-interfaces.html)
8
9use crate::arg_of;
10use asterust::config::ConfigLine;
11
12/// The `es-options` of an interface.
13#[derive(Clone, Debug, PartialEq, Eq)]
14#[non_exhaustive]
15pub struct EsOptions {
16 pub backup_interface: Option<String>,
17}
18
19pub(super) fn parse_es_options(options: &ConfigLine) -> EsOptions {
20 EsOptions {
21 backup_interface: arg_of(options, "backup-interface").map(str::to_string),
22 }
23}