Struct GCPluginInterface
#[repr(transparent)]pub struct GCPluginInterface(sGCPluginInterface);Expand description
Zero cost abstraction over the GCPluginInterface Safety: All the function calls are valid as long as the underlying GCPluginInterface pointer is valid
Tuple Fields§
§0: sGCPluginInterfaceImplementations§
§impl GCPluginInterface
impl GCPluginInterface
pub unsafe fn new<T>(
config: GCPluginConfig,
ctx: *const T,
exports: GCCoreExportedFunctions,
log_level: GCLogLevel,
) -> Self
pub unsafe fn new<T>( config: GCPluginConfig, ctx: *const T, exports: GCCoreExportedFunctions, log_level: GCLogLevel, ) -> Self
Create a new GCPluginInterface
§Safety
The caller is responsible for ensuring the ctx and config are valid for the lifetime of the GCPluginInterface
pub fn publish_datapoint(&self, datapoint_value: &GCDatapointValue) -> bool
pub fn publish_datapoint(&self, datapoint_value: &GCDatapointValue) -> bool
Publishes a datapoint value
pub fn store_datapoint(&self, datapoint_value: &GCDatapointValue)
pub fn store_datapoint(&self, datapoint_value: &GCDatapointValue)
Stores a datapoint value in the timeseries database
pub fn get_config(&self) -> &GCPluginConfig
pub fn get_config(&self) -> &GCPluginConfig
Returns the configuration of the plugin
pub unsafe fn get_last_datapoint_value(
&self,
datapoint_id: GCDatapointID,
) -> *const GCDatapointValue
pub unsafe fn get_last_datapoint_value( &self, datapoint_id: GCDatapointID, ) -> *const GCDatapointValue
Retrieve the last value of a datapoint from the realtime database
§Safety
The caller is responsible for freeing the memory of the returned value and also it has to ensure the pointer is not null
pub fn log(&self, level: eGCLogLevel, message: &CStr)
pub fn log(&self, level: eGCLogLevel, message: &CStr)
Log a message
pub fn get_raw_log_level(&self) -> eGCLogLevel
pub fn get_raw_log_level(&self) -> eGCLogLevel
Get the C log level of the plugin
pub fn get_log_level(&self) -> Result<GCLogLevel, GCPluginABIError>
pub fn get_log_level(&self) -> Result<GCLogLevel, GCPluginABIError>
Get the log level of the plugin
pub fn get_ethernet_interface(&self, name: &CStr) -> Option<GCEthernetInterface>
pub fn get_ethernet_interface(&self, name: &CStr) -> Option<GCEthernetInterface>
Retrieves an Ethernet interface configuration by logical name.
pub fn get_serial_interface(&self, name: &CStr) -> Option<GCSerialInterface>
pub fn get_serial_interface(&self, name: &CStr) -> Option<GCSerialInterface>
Retrieves a serial interface configuration by logical name.