1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use ;
/// A service that processes envelopes and returns replies.
///
/// Implement this trait to create custom services in BakBon.
///
/// # Examples
///
/// ```rust
/// use bakbon::*;
///
/// #[derive(Debug)]
/// pub struct NilService(Address);
///
/// impl Service for NilService {
/// fn address(&self) -> &Address { &self.0 }
///
/// fn duplicate(&self) -> ServiceBox {
/// let address = self.address().clone();
/// Box::new(Self(address))
/// }
///
/// fn process(&self, message: Envelope) -> Result<Reply> {
/// Ok(None)
/// }
/// }
/// ```
/// A boxed service that can be cloned and processed.
pub type ServiceBox = ;
/// A vector of boxed services.
pub type ServiceVec = ;
/// A map of service vectors indexed by service name.
pub type ServiceMap = ;