remote-trait-object 0.4.2

A remote method invocation library based on trait objects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::packet::PacketView;

pub trait Handler: Send + Sync {
    fn handle(&self, input: PacketView) -> Vec<u8>;
}

impl<F> Handler for F
where
    F: Fn(PacketView) -> Vec<u8> + Send + Sync,
{
    fn handle(&self, input: PacketView) -> Vec<u8> {
        self(input)
    }
}