Skip to main content

UiState

Struct UiState 

Source
struct UiState<B: Backend> {
    backend: Rc<B>,
    layout: Layout<B::Widget>,
    windows: Vec<Option<WindowState<B>>>,
    on_close: Option<WindowCloseHandler>,
}

Fields§

§backend: Rc<B>§layout: Layout<B::Widget>§windows: Vec<Option<WindowState<B>>>

Indexed by WindowId; None once closed, so the ids of other windows stay valid.

§on_close: Option<WindowCloseHandler>

What runs when the user asks to close a window; without one, it closes.

Implementations§

Source§

impl<B: Backend> UiState<B>

Source

fn window(&self, window: WindowId) -> &WindowState<B>

Source

fn invalidate(&mut self, window: WindowId)

Source

fn resize(&mut self, window: WindowId, size: Size)

A closed window can still report a resize that was already on its way, so that is ignored rather than treated as a mistake.

Source

fn remove_tree(&mut self, node: NodeId)

Removes node and everything under it, taking their widgets off screen.

Source

fn layout_window(&mut self, window: WindowId)

Auto Trait Implementations§

§

impl<B> !RefUnwindSafe for UiState<B>

§

impl<B> !Send for UiState<B>

§

impl<B> !Sync for UiState<B>

§

impl<B> !UnwindSafe for UiState<B>

§

impl<B> Freeze for UiState<B>

§

impl<B> Unpin for UiState<B>
where <B as Backend>::Widget: Unpin,

§

impl<B> UnsafeUnpin for UiState<B>

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.