All checks were successful
Run Check Script / check (pull_request) Successful in 1m15s
This includes Id, IpAddress, Url and some other heavily used types
25 lines
784 B
Rust
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()
|
|
))
|
|
}
|
|
}
|