Files
harmony/harmony/src/domain/topology/tftp.rs
Jean-Gabriel Gill-Couture f9906cb419
All checks were successful
Run Check Script / check (pull_request) Successful in 1m15s
refact: Move basic types to harmony_types crate to avoid external dependencies.
This includes Id, IpAddress, Url and some other heavily used types
2025-08-30 18:01:14 -04:00

25 lines
784 B
Rust

use crate::executors::ExecutorError;
use async_trait::async_trait;
use harmony_types::net::{IpAddress, Url};
#[async_trait]
pub trait TftpServer: Send + Sync {
async fn serve_files(&self, url: &Url) -> Result<(), ExecutorError>;
fn get_ip(&self) -> IpAddress;
async fn set_ip(&self, ip: IpAddress) -> Result<(), ExecutorError>;
async fn ensure_initialized(&self) -> Result<(), ExecutorError>;
async fn commit_config(&self) -> Result<(), ExecutorError>;
async fn reload_restart(&self) -> Result<(), ExecutorError>;
}
impl std::fmt::Debug for dyn TftpServer {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!(
"TftpServer serving files at {}",
self.get_ip()
))
}
}