pub struct UseWindowSize {
pub width: Signal<i32>,
pub height: Signal<i32>,
/* private fields */
}Expand description
Reactive state for the window’s size.
The handle carries the viewport’s width and height and the teardown that removes the window listener.
The size is a Signal<i32>: a render closure that reads it
re-renders when the window is resized.
Fields§
§width: Signal<i32>The viewport width in CSS pixels.
height: Signal<i32>The viewport height in CSS pixels.
Implementations§
Source§impl UseWindowSize
Inherent implementation of UseWindowSize.
impl UseWindowSize
Inherent implementation of UseWindowSize.
Sourcepub fn current_width(&self) -> i32
pub fn current_width(&self) -> i32
Sourcepub fn current_height(&self) -> i32
pub fn current_height(&self) -> i32
Source§impl UseWindowSize
impl UseWindowSize
pub fn get_width(&self) -> Signal<i32>
pub fn get_mut_width(&mut self) -> &mut Signal<i32>
pub fn set_width(&mut self, val: Signal<i32>) -> &mut Self
pub fn get_height(&self) -> Signal<i32>
pub fn get_mut_height(&mut self) -> &mut Signal<i32>
pub fn set_height(&mut self, val: Signal<i32>) -> &mut Self
pub fn get_mut_teardown(&mut self) -> &mut Rc<RefCell<Option<Box<dyn Fn()>>>>
pub fn set_teardown( &mut self, val: Rc<RefCell<Option<Box<dyn Fn()>>>>, ) -> &mut Self
Trait Implementations§
Source§impl Clone for UseWindowSize
impl Clone for UseWindowSize
Source§impl Debug for UseWindowSize
impl Debug for UseWindowSize
Auto Trait Implementations§
impl !RefUnwindSafe for UseWindowSize
impl !Send for UseWindowSize
impl !Sync for UseWindowSize
impl !UnwindSafe for UseWindowSize
impl Freeze for UseWindowSize
impl Unpin for UseWindowSize
impl UnsafeUnpin for UseWindowSize
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