Compare commits
1 Commits
77e09436a9
...
ad61be277b
Author | SHA1 | Date | |
---|---|---|---|
|
ad61be277b |
@ -39,7 +39,7 @@ impl FromStr for PortLocation {
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::str::FromStr;
|
||||
/// use harmony_types::switch::PortLocation;
|
||||
/// use brocade::port::PortLocation;
|
||||
///
|
||||
/// assert_eq!(PortLocation::from_str("1/1/1").unwrap(), PortLocation(1, 1, 1));
|
||||
/// assert_eq!(PortLocation::from_str("12/5/48").unwrap(), PortLocation(12, 5, 48));
|
||||
@ -64,8 +64,8 @@ impl FromStr for PortLocation {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a Port configuration input, which can be a single port, a sequential range,
|
||||
/// or an explicit set defined by endpoints.
|
||||
/// Represents a Brocade Port configuration input, which can be a single port, a sequential
|
||||
/// range, or an explicit set defined by endpoints.
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
|
||||
pub enum PortDeclaration {
|
||||
/// A single switch port defined by its location. Example: `PortDeclaration::Single(1/1/1)`
|
||||
@ -82,7 +82,7 @@ pub enum PortDeclaration {
|
||||
}
|
||||
|
||||
impl PortDeclaration {
|
||||
/// Parses a port configuration string into a structured `PortDeclaration` enum.
|
||||
/// Parses a Brocade port configuration string into a structured `PortDeclaration` enum.
|
||||
///
|
||||
/// This function performs only basic format and numerical parsing, assuming the input
|
||||
/// strings (e.g., from `show` commands) are semantically valid and logically ordered.
|
||||
@ -101,7 +101,7 @@ impl PortDeclaration {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use harmony_types::switch::{PortDeclaration, PortLocation};
|
||||
/// use brocade::port::{PortDeclaration, PortLocation};
|
||||
///
|
||||
/// // Single Port
|
||||
/// assert_eq!(PortDeclaration::parse("3/2/15").unwrap(), PortDeclaration::Single(PortLocation(3, 2, 15)));
|
||||
@ -150,7 +150,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_parse_port_location_invalid() {
|
||||
fn test_parse_single_port_location_invalid() {
|
||||
assert!(PortLocation::from_str("1/1").is_err());
|
||||
assert!(PortLocation::from_str("1/A/1").is_err());
|
||||
assert!(PortLocation::from_str("1/1/256").is_err());
|
||||
|
Loading…
Reference in New Issue
Block a user