pub trait DataPlugin: Any {
type DataContainer;
// Required methods
fn init(context: &impl PluginContext) -> Self::DataContainer;
fn index_within_context() -> usize;
}
Expand description
A trait for objects that can provide data containers to be held by Context
Required Associated Types§
type DataContainer
Required Methods§
fn init(context: &impl PluginContext) -> Self::DataContainer
Sourcefn index_within_context() -> usize
fn index_within_context() -> usize
Returns the index into Context::data_plugins
, the vector of data plugins, where
the instance of this data plugin can be found.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.