use gc_plugin_abi::*;
#[gc_plugin]
pub struct RestSomethingPlugin {}
impl Default for RestSomethingPlugin {
fn default() -> Self {
Self::new()
}
}
impl RestSomethingPlugin {
pub fn new() -> Self {
Self {}
}
}
impl<'a> GCPluginInstance<'a> for RestSomethingPlugin {
fn get_plugin_info() -> GCPluginInfo {
GCPluginInfo::new("RestSomethingPlugin", "0.1.0", "0", 0)
}
fn receive_datapoint(&self, _data_value: GCBorrowedDatapointValue) -> bool {
true
}
fn init(_plugin_interface: &'a GCPluginInterface) -> Box<Self> {
Box::new(RestSomethingPlugin::new())
}
}
#[cfg(test)]
mod tests {
use gc_plugin_abi::raw::{self, GCInfoPluginExport, GCInitPluginExport, GCReceiveDatapointPluginExport, GCShutdownPluginExport};
use gc_utils::testing::gc_integration_test;
#[gc_integration_test]
fn test_function_signatures() {
let _gc_plugin_init_check: GCInitPluginExport = raw::gc_plugin_init;
let _gc_plugin_shutdown_check: GCShutdownPluginExport = raw::gc_plugin_shutdown;
let _gc_plugin_receive_datapoint_check: GCReceiveDatapointPluginExport = raw::gc_plugin_receive_datapoint;
let _gc_plugin_get_info_check: GCInfoPluginExport = raw::gc_plugin_get_info;
}
}