pub trait DataContext {
// Required method
fn data<T>(&self) -> Option<&T>
where T: 'static;
// Provided method
fn localization_context(&self) -> Option<LocalizationContext<'_>> { ... }
}
Expand description
A trait for any Context-like object that lets you access stored model data.
This lets e.g Lens::get be generic over any of these types.
Required Methods§
Provided Methods§
Sourcefn localization_context(&self) -> Option<LocalizationContext<'_>>
fn localization_context(&self) -> Option<LocalizationContext<'_>>
Convert the current context into a LocalizationContext.
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.