pub struct InterfaceName {
pub kind: InterfaceKind,
pub id: String,
pub original: String,
}Expand description
Parsed and normalized interface name.
Abbreviated names (Gi, Fa, Te, Lo, …) are expanded to their
canonical long form. The original string is preserved in original.
Fields§
§kind: InterfaceKindInterface type.
id: StringSlot/port identifier as a string: "0/0", "0/0/0", "1", etc.
original: StringVerbatim name from the config, before any normalization.
Implementations§
Source§impl InterfaceName
impl InterfaceName
Sourcepub fn parse(raw: &str) -> Self
pub fn parse(raw: &str) -> Self
Parse a raw interface name string, expanding Cisco abbreviations.
use ios_config_core::ir::{InterfaceName, InterfaceKind};
let name = InterfaceName::parse("Gi0/1");
assert_eq!(name.kind, InterfaceKind::GigabitEthernet);
assert_eq!(name.id, "0/1");
assert_eq!(name.original, "Gi0/1");Trait Implementations§
Source§impl Clone for InterfaceName
impl Clone for InterfaceName
Source§fn clone(&self) -> InterfaceName
fn clone(&self) -> InterfaceName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InterfaceName
impl Debug for InterfaceName
Source§impl<'de> Deserialize<'de> for InterfaceName
impl<'de> Deserialize<'de> for InterfaceName
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InterfaceName
impl RefUnwindSafe for InterfaceName
impl Send for InterfaceName
impl Sync for InterfaceName
impl Unpin for InterfaceName
impl UnsafeUnpin for InterfaceName
impl UnwindSafe for InterfaceName
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