Skip to main content

ImmutableLayouter

Trait ImmutableLayouter 

Source
pub trait ImmutableLayouter<W, K, N, T, V, P>
where W: ImmutableWeave<K, N, T>, K: Hash + Copy + Eq + Ord, N: Node<K, T>,
{ // 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§

Source

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.

Source

fn size(&self) -> V

Returns the size of the bounding box enclosing the arrangement’s content.

Source

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".

Implementors§