Trait vizia_core::context::DataContext

source ·
pub trait DataContext {
    // Required method
    fn data<T: 'static>(&self) -> Option<&T>;

    // Provided method
    fn as_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§

source

fn data<T: 'static>(&self) -> Option<&T>

Get model/view data from the context. Returns None if the data does not exist.

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§