Skip to main content

LayoutModuleCapture

Struct LayoutModuleCapture 

Source
pub struct LayoutModuleCapture<Module, ElementsOutput: Clone + Serialize> { /* private fields */ }
Expand description

Wraps a layout manager and accumulates layout output across frames.

Implements LayoutManager and LayoutManagerCompatible, delegating all operations to the inner module while copying each frame’s output into an internal vector accessible via output.

Use for single-frame capture: run one compute_frame, then call store_computed_layout with output().

If used across multiple frames, output() grows unbounded — each frame’s results are appended. There is no automatic reset; avoid multi-frame capture unless you manage the accumulated vector explicitly.

Implementations§

Source§

impl<Module, ElementsOutput: Clone + Serialize> LayoutModuleCapture<Module, ElementsOutput>

Source

pub fn new(internal: Module) -> Self

Creates a capture wrapper around an existing layout manager.

Source

pub fn output(&self) -> &Vec<ElementsOutput>

Returns all layout output accumulated so far across every captured frame.

Trait Implementations§

Source§

impl<'frame, Module, ElementsOutput: 'frame + Clone + Serialize, ConfigType: 'frame> LayoutManager<'frame, ConfigType, ElementsOutput> for LayoutModuleCapture<Module, ElementsOutput>
where Module: LayoutManager<'frame, ConfigType, ElementsOutput>,

Source§

type ElementConfigurer<'layout> = <Module as LayoutManager<'frame, ConfigType, ElementsOutput>>::ElementConfigurer<'layout> where Self: 'layout, ConfigType: 'frame, ElementsOutput: 'frame

The configurator type used while constructing one frame.
Source§

fn begin_frame<'layout>( &'layout mut self, ) -> impl LayoutFrameManager<'frame, ConfigType, ElementsOutput, Self::ElementConfigurer<'layout>>
where Self: 'layout, ConfigType: 'frame, ElementsOutput: 'frame,

Starts a new frame and returns a frame manager used to build UI.
Source§

impl<Module, ElementsOutput: Clone + Serialize, Render> LayoutManagerCompatible<Render> for LayoutModuleCapture<Module, ElementsOutput>
where Module: LayoutManagerCompatible<Render>,

Source§

fn init(&mut self, renderer: &mut Render)

Initializes layout manager state against a renderer. Read more
Source§

fn prepare(&mut self, render: &Render)

Prepares the layout manager before starting a new frame.

Auto Trait Implementations§

§

impl<Module, ElementsOutput> Freeze for LayoutModuleCapture<Module, ElementsOutput>
where Module: Freeze,

§

impl<Module, ElementsOutput> RefUnwindSafe for LayoutModuleCapture<Module, ElementsOutput>
where Module: RefUnwindSafe, ElementsOutput: RefUnwindSafe,

§

impl<Module, ElementsOutput> Send for LayoutModuleCapture<Module, ElementsOutput>
where Module: Send, ElementsOutput: Send,

§

impl<Module, ElementsOutput> Sync for LayoutModuleCapture<Module, ElementsOutput>
where Module: Sync, ElementsOutput: Sync,

§

impl<Module, ElementsOutput> Unpin for LayoutModuleCapture<Module, ElementsOutput>
where Module: Unpin, ElementsOutput: Unpin,

§

impl<Module, ElementsOutput> UnsafeUnpin for LayoutModuleCapture<Module, ElementsOutput>
where Module: UnsafeUnpin,

§

impl<Module, ElementsOutput> UnwindSafe for LayoutModuleCapture<Module, ElementsOutput>
where Module: UnwindSafe, ElementsOutput: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.