pub trait Service: Send + Sync {
// Required method
fn protocol(&self) -> &[u8] ⓘ;
}Expand description
Trait that all ma services must implement.
Each service declares its protocol identifier and provides a handler for incoming connections. Built-in services ship with ma-core; applications add custom services via this trait.
§Examples
use ma_core::Service;
struct MyService;
impl Service for MyService {
fn protocol(&self) -> &[u8] { b"/ma/my-service/0.0.1" }
}