pub struct WindowCtx(/* private fields */);
Expand description
Defines the backing data of WINDOW
.
Each window owns this data and calls WINDOW.with_context
to delegate to it’s child node.
Implementations§
source§impl WindowCtx
impl WindowCtx
sourcepub fn new(id: WindowId, mode: WindowMode) -> Self
pub fn new(id: WindowId, mode: WindowMode) -> Self
New window context.
sourcepub fn set_widget_tree(&mut self, widget_tree: WidgetInfoTree)
pub fn set_widget_tree(&mut self, widget_tree: WidgetInfoTree)
Sets the widget tree, must be called after every info update.
Window contexts are partially available in the window new closure, but values like the widget_tree
is
available on init, so a WidgetInfoTree::wgt
must be set as soon as the window and widget ID are available.
sourcepub fn mode(&self) -> WindowMode
pub fn mode(&self) -> WindowMode
Gets the window mode.
sourcepub fn widget_tree(&self) -> WidgetInfoTree
pub fn widget_tree(&self) -> WidgetInfoTree
Gets the window tree.
sourcepub fn with_state<R>(
&mut self,
f: impl FnOnce(&mut OwnedStateMap<WINDOW>) -> R,
) -> R
pub fn with_state<R>( &mut self, f: impl FnOnce(&mut OwnedStateMap<WINDOW>) -> R, ) -> R
Call f
with an exclusive lock to the window state.
Clone a reference to the window context.
This must be used only if the window implementation is split.
Auto Trait Implementations§
impl Freeze for WindowCtx
impl !RefUnwindSafe for WindowCtx
impl Send for WindowCtx
impl Sync for WindowCtx
impl Unpin for WindowCtx
impl !UnwindSafe for WindowCtx
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more