Trait DataPlugin

Source
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§

Required Methods§

Source

fn init(context: &impl PluginContext) -> Self::DataContainer

Source

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.

Implementors§