pub struct LayoutBoundsHandle(/* private fields */);Expand description
An application-owned receiver for the window-relative bounds QuickGUI laid out for one element.
Store the handle next to the state that depends on the element’s real size — a splitter that
must match its container, a scroll area that must know its viewport and content extents — bind
it with Element::report_bounds, and read Self::bounds while declaring the next frame.
Like AnchorPlacementHandle, it retains one small allocation and no task, timer, observer, or
idle scheduler source: QuickGUI writes it during the paint it was already performing and
requests exactly one correcting frame when the bounds changed, so a settled window stays
settled.
use quickgui::{LayoutBoundsHandle, div};
let bounds = LayoutBoundsHandle::new();
assert_eq!(bounds.bounds(), None);
let pane = div().report_bounds(bounds.clone());
assert!(pane.reports_bounds());Implementations§
Trait Implementations§
Source§impl Clone for LayoutBoundsHandle
impl Clone for LayoutBoundsHandle
Source§fn clone(&self) -> LayoutBoundsHandle
fn clone(&self) -> LayoutBoundsHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutBoundsHandle
impl Debug for LayoutBoundsHandle
Source§impl Default for LayoutBoundsHandle
impl Default for LayoutBoundsHandle
Source§fn default() -> LayoutBoundsHandle
fn default() -> LayoutBoundsHandle
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LayoutBoundsHandle
impl !Send for LayoutBoundsHandle
impl !Sync for LayoutBoundsHandle
impl !UnwindSafe for LayoutBoundsHandle
impl Freeze for LayoutBoundsHandle
impl Unpin for LayoutBoundsHandle
impl UnsafeUnpin for LayoutBoundsHandle
Blanket Implementations§
impl<T> Action for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.