pub trait ImmutableLayouter<W, K, N, T, V, P>{
// Required methods
fn layout(&mut self, weave: &W, sizes: impl FnMut(&K) -> V);
fn size(&self) -> V;
fn view(
&mut self,
min: V,
max: V,
callback: impl FnMut(LayoutItem<K, V, P>),
);
}Expand description
An algorithm which arranges an ImmutableWeave’s content for graphical rendering in an efficiently accessible form.
§Panics
All panics should be assumed to leave the Layouter in a malformed state unless otherwise specified by the implementation.
Required Methods§
Sourcefn layout(&mut self, weave: &W, sizes: impl FnMut(&K) -> V)
fn layout(&mut self, weave: &W, sizes: impl FnMut(&K) -> V)
Arranges an ImmutableWeave’s content for graphical rendering using a closure which maps Nodes to their dimensions.
§Panics
Panics if the ImmutableWeave’s content could not be arranged due to an unsatisfiable constraint or numerical overflow.
May panic if map panics or if the underlying ImmutableWeave is improperly implemented.
Sourcefn view(&mut self, min: V, max: V, callback: impl FnMut(LayoutItem<K, V, P>))
fn view(&mut self, min: V, max: V, callback: impl FnMut(LayoutItem<K, V, P>))
Returns LayoutItems within the specified bounds in the order that they should be rendered.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".