pub trait MemoryFromConfig {
// Required method
fn from_config(config: &MemoryConfig) -> Self;
}Expand description
Extension trait for creating memory backends from TOML configuration.
§Example
use enki_runtime::{InMemoryBackend, MemoryFromConfig};
use enki_runtime::config::MemoryConfig;
let config = MemoryConfig::in_memory().with_max_entries(1000);
let memory = InMemoryBackend::from_config(&config);Required Methods§
Sourcefn from_config(config: &MemoryConfig) -> Self
fn from_config(config: &MemoryConfig) -> Self
Create a memory backend from a MemoryConfig.
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.