feat: provide an unmanaged switch
Some checks failed
Run Check Script / check (pull_request) Failing after 40s

This commit is contained in:
Jérémy Viau-Trudel 2025-11-11 13:30:03 -05:00
parent 83c1cc82b6
commit 734c9704ab

View File

@ -113,6 +113,37 @@ impl SwitchClient for BrocadeSwitchClient {
} }
} }
#[derive(Debug)]
pub struct UnmanagedSwitch;
impl UnmanagedSwitch {
pub async fn init( ) -> Result<Self, ()> {
Ok(Self)
}
}
#[async_trait]
impl SwitchClient for UnmanagedSwitch {
async fn setup(&self) -> Result<(), SwitchError> {
todo!("unmanaged switch. Nothing to do.")
}
async fn find_port(
&self,
mac_address: &MacAddress,
) -> Result<Option<PortLocation>, SwitchError> {
todo!("unmanaged switch. Nothing to do.")
}
async fn configure_port_channel(
&self,
channel_name: &str,
switch_ports: Vec<PortLocation>,
) -> Result<u8, SwitchError> {
todo!("unmanaged switch. Nothing to do.")
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};