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
53
//! Plugins for Trunk Recorder Pro.
//!
//! A plugin is a program of its own that the recorder starts, sends events to
//! (calls starting, ending and landing on disk; radios registering; live
//! audio; status) and stops. It only watches: nothing it does changes what is
//! recorded. The [`protocol`] is JSON lines over stdin/stdout, so a plugin
//! can be written in anything; this crate is the Rust side of it.
//!
//! ```no_run
//! use trunk_recorder_plugin::{topic, ConcludedCall, Host, Manifest, NoConfig, Plugin, Setup};
//!
//! struct Hello { host: Host }
//!
//! impl Plugin for Hello {
//! type Config = NoConfig;
//! type SystemConfig = NoConfig;
//! fn manifest() -> Manifest {
//! Manifest { name: "Hello".into(), subscribe: vec![topic::CALL_CONCLUDED.into()], ..trunk_recorder_plugin::manifest!() }
//! }
//! fn start(host: Host, _: Setup<NoConfig, NoConfig>) -> Result<Self, String> {
//! Ok(Hello { host })
//! }
//! fn call_concluded(&mut self, call: ConcludedCall) {
//! self.host.info(format!("TG {} for {} s", call.call.talkgroup, call.call.call_length));
//! }
//! }
//!
//! fn main() {
//! trunk_recorder_plugin::run::<Hello>();
//! }
//! ```
pub use TalkgroupFilter;
pub use ;
pub use Multipart;
pub use *;
pub use *;