pub trait Fill {
// Required methods
fn fill(
&mut self,
full_name: &str,
key: Key,
params: &Value,
ui: &mut Ui<'_>,
);
fn finish(&mut self, ui: &mut Ui<'_>);
// Provided method
fn add(
&mut self,
namespace: &str,
ext: Box<dyn Extension>,
) -> Result<OriginId, String> { ... }
}Expand description
What fills slots: the runner’s extension list, or a test’s stand-in.
A frame begun with Core::frame_with carries one; Ui::slot calls
Fill::fill at the position the host declared, and Ui::finish
calls Fill::finish once the host’s view is done.
Required Methods§
Provided Methods§
Sourcefn add(
&mut self,
namespace: &str,
ext: Box<dyn Extension>,
) -> Result<OriginId, String>
fn add( &mut self, namespace: &str, ext: Box<dyn Extension>, ) -> Result<OriginId, String>
Loads ext under namespace, mid-frame, and answers with the
origin it got — what a guest that hosts guests of its own calls
(env.add_extension in Lua). It joins the same list as everyone
else, so namespace has to be free of the host’s names too.
The default refuses: a Fill that is not a list of extensions has
nowhere to put one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Implementors§
impl Fill for Extensions
The runner’s loop, as a Fill. A declared name is split at its last
/ into the namespace and the extension’s own slot name; the
extension under that namespace fills it if it lists the name (or the
name is "root" and it lists none). A view that errors leaves its
message in the tree (red, where the fill would have been) and raises
extension-view-error, once per extension and slot.