pub struct ComponentUpdater<'a, 'b: 'a, 'c: 'a> { /* private fields */ }Expand description
Provides information and operations that low level component implementations may need to utilize during the update phase.
Implementations§
Source§impl<'a, 'b, 'c> ComponentUpdater<'a, 'b, 'c>
impl<'a, 'b, 'c> ComponentUpdater<'a, 'b, 'c>
Sourcepub fn terminal_events(&mut self) -> Option<TerminalEvents>
pub fn terminal_events(&mut self) -> Option<TerminalEvents>
Puts the terminal into raw mode if it isn’t already, and returns a stream of terminal events.
Sourcepub fn is_terminal_raw_mode_enabled(&self) -> bool
pub fn is_terminal_raw_mode_enabled(&self) -> bool
Returns whether the terminal is in raw mode.
Sourcepub fn clear_terminal_output(&mut self)
pub fn clear_terminal_output(&mut self)
Removes the currently rendered output from the terminal, e.g. to allow for the printing of output above the component.
Sourcepub fn get_context<T: Any>(&self) -> Option<Ref<'_, T>>
pub fn get_context<T: Any>(&self) -> Option<Ref<'_, T>>
Gets an immutable reference to context of the given type.
Sourcepub fn get_context_mut<T: Any>(&self) -> Option<RefMut<'_, T>>
pub fn get_context_mut<T: Any>(&self) -> Option<RefMut<'_, T>>
Gets a mutable reference to context of the given type.
Sourcepub fn set_layout_style(&mut self, layout_style: Style)
pub fn set_layout_style(&mut self, layout_style: Style)
Sets the layout style of the current component.
Sourcepub fn set_measure_func(
&mut self,
measure_func: Box<dyn Fn(Size<Option<f32>>, Size<AvailableSpace>, &Style) -> Size<f32> + Send>,
)
pub fn set_measure_func( &mut self, measure_func: Box<dyn Fn(Size<Option<f32>>, Size<AvailableSpace>, &Style) -> Size<f32> + Send>, )
Sets the measure function of the current component, which is invoked to calculate the area that the component’s content should occupy.
Sourcepub fn set_transparent_layout(&mut self, transparent_layout: bool)
pub fn set_transparent_layout(&mut self, transparent_layout: bool)
If set to true, the layout of the current component will be transparent, meaning that
children will effectively be direct descendants of the parent of the current component for
layout purposes.
Sourcepub fn update_children<I, T>(
&mut self,
children: I,
context: Option<Context<'_>>,
)where
I: IntoIterator<Item = T>,
T: ElementExt,
pub fn update_children<I, T>(
&mut self,
children: I,
context: Option<Context<'_>>,
)where
I: IntoIterator<Item = T>,
T: ElementExt,
Updates the children of the current component.