netget-tool 0.3.4

Network protocol stubbing toolkit: ~280 protocol servers and clients whose responses come from an LLM, a script, a static rule or a person.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Common trait and utilities for network servers

use anyhow::Result;
use async_trait::async_trait;

/// Common trait for network servers that can be spawned
#[async_trait]
pub trait NetworkServer: Send + Sync + 'static {
    /// Start the server and run its main loop
    async fn start(self) -> Result<()>;

    /// Get the server name for logging
    fn name(&self) -> &str;
}