pub trait TestContextExt {
    // Required method
    fn setup_viewport_blueprint<R>(
        &mut self,
        setup_blueprint: impl FnOnce(&ViewerContext<'_>, &mut ViewportBlueprint) -> R,
    ) -> R;
}
Expand description

Extension trait to [TestContext] for blueprint-related features.

Required Methods§

source

fn setup_viewport_blueprint<R>( &mut self, setup_blueprint: impl FnOnce(&ViewerContext<'_>, &mut ViewportBlueprint) -> R, ) -> R

See docstring on the implementation below.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TestContextExt for TestContext

source§

fn setup_viewport_blueprint<R>( &mut self, setup_blueprint: impl FnOnce(&ViewerContext<'_>, &mut ViewportBlueprint) -> R, ) -> R

Inspect or update the blueprint of a [TestContext].

This helper works by deserializing the current blueprint, providing it to the provided closure, and saving it back to the blueprint store. The closure should call the appropriate methods of ViewportBlueprint to inspect and/or create views and containers as required.

Each time TestContextExt::setup_viewport_blueprint is called, it entirely recomputes the “query results”, i.e., the [re_viewer_context::DataResult]s that each view contains, based on the current content of the recording store.

Important pre-requisite:

  • The view classes used by view must be already registered (see [TestContext::register_view_class]).
  • The data store must be already populated for the views to have any content (see, e.g., [TestContext::log_entity]).

Implementors§