pub trait ViewPathTracker {
// Required methods
fn environment(&mut self) -> &mut Environment;
fn push_id(&mut self, id: ViewId);
fn pop_id(&mut self);
fn view_path(&mut self) -> &[ViewId];
// Provided method
fn with_id<R>(&mut self, id: ViewId, f: impl FnOnce(&mut Self) -> R) -> R { ... }
}Expand description
A tracker for view paths, used in View::build and View::rebuild.
These paths are used for routing messages in View::message.
Each View is expected to be implemented for one logical context type,
and this context may be used to store auxiliary data.
For example, this context could be used to store a mapping from the
id of widget to view path, to enable event routing.
Required Methods§
Sourcefn environment(&mut self) -> &mut Environment
fn environment(&mut self) -> &mut Environment
Access the Environment associated with this context.
I hope that we can remove the “context” generic entirely, and so this is here on a temporary basis.
Provided Methods§
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.