Struct ComponentUpdater

Source
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>

Source

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.

Source

pub fn is_terminal_raw_mode_enabled(&self) -> bool

Returns whether the terminal is in raw mode.

Source

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.

Source

pub fn get_context<T: Any>(&self) -> Option<Ref<'_, T>>

Gets an immutable reference to context of the given type.

Source

pub fn get_context_mut<T: Any>(&self) -> Option<RefMut<'_, T>>

Gets a mutable reference to context of the given type.

Source

pub fn set_layout_style(&mut self, layout_style: Style)

Sets the layout style of the current component.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a, 'b, 'c> Freeze for ComponentUpdater<'a, 'b, 'c>

§

impl<'a, 'b, 'c> !RefUnwindSafe for ComponentUpdater<'a, 'b, 'c>

§

impl<'a, 'b, 'c> Send for ComponentUpdater<'a, 'b, 'c>

§

impl<'a, 'b, 'c> !Sync for ComponentUpdater<'a, 'b, 'c>

§

impl<'a, 'b, 'c> Unpin for ComponentUpdater<'a, 'b, 'c>

§

impl<'a, 'b, 'c> !UnwindSafe for ComponentUpdater<'a, 'b, 'c>

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> Any for T
where T: Any,

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.