pub struct UseWindowBuilder {
pub missing_x: usize,
pub missing_y: usize,
}Expand description
Build window size hook with config
Fields§
§missing_x: usize§missing_y: usizeImplementations§
Source§impl UseWindowBuilder
impl UseWindowBuilder
Sourcepub fn use_width<'a>(&self, cx: &'a ScopeState) -> &'a mut UseWindowWidth
pub fn use_width<'a>(&self, cx: &'a ScopeState) -> &'a mut UseWindowWidth
hooks for window’s width with config
§Arguments
returns: UseWindowWidth
§Examples
use dioxus::prelude::*;
use dioxus_use_window::{UseWindowBuilder};
fn App(cx: Scope) -> Element {
let hook = UseWindowBuilder::default().use_width(&cx);
cx.render(rsx!(
h1 { "Window width: {hook}" }
))
}Sourcepub fn use_layout<'a, T>(
&self,
cx: &'a ScopeState,
) -> &'a mut UseWindowLayout<T>where
T: 'static,
pub fn use_layout<'a, T>(
&self,
cx: &'a ScopeState,
) -> &'a mut UseWindowLayout<T>where
T: 'static,
hooks for window’s layout with config
§Arguments
returns: UseWindowLayout
§Examples
use dioxus::prelude::*;
use dioxus_use_window::{ResponsiveLayout, UseWindowBuilder};
fn App(cx: Scope) -> Element {
let hook = UseWindowBuilder::default().use_layout::<ResponsiveLayout>(&cx);
cx.render(rsx!(
h1 { "Window layout: {hook}" }
))
}Sourcepub fn use_responsive_layout<'a>(
&self,
cx: &'a ScopeState,
) -> &'a mut UseWindowLayout<ResponsiveLayout>
pub fn use_responsive_layout<'a>( &self, cx: &'a ScopeState, ) -> &'a mut UseWindowLayout<ResponsiveLayout>
hooks for window’s responsive layout with config
§Arguments
returns: UseWindowLayout
§Examples
use dioxus::prelude::*;
use dioxus_use_window::{ResponsiveLayout, UseWindowBuilder};
fn App(cx: Scope) -> Element {
let hook = UseWindowBuilder::default().use_responsive_layout(&cx);
cx.render(rsx!(
h1 { "Window layout: {hook}" }
))
}Source§impl UseWindowBuilder
impl UseWindowBuilder
Sourcepub fn use_browser<'a>(&self, cx: &'a ScopeState) -> &'a mut UseBrowser
pub fn use_browser<'a>(&self, cx: &'a ScopeState) -> &'a mut UseBrowser
hooks for window’s height with config
§Arguments
returns: UseWindowHeight
§Examples
use dioxus::prelude::*;
use dioxus_use_window::{UseWindowBuilder};
fn App(cx: Scope) -> Element {
let hook = UseWindowBuilder::default().use_browser(&cx);
cx.render(rsx!(
h1 { "Window height: {hook}" }
))
}Source§impl UseWindowBuilder
impl UseWindowBuilder
Sourcepub fn use_height<'a>(&self, cx: &'a ScopeState) -> &'a mut UseWindowHeight
pub fn use_height<'a>(&self, cx: &'a ScopeState) -> &'a mut UseWindowHeight
hooks for window’s height with config
§Arguments
returns: UseWindowHeight
§Examples
use dioxus::prelude::*;
use dioxus_use_window::{UseWindowBuilder};
fn App(cx: Scope) -> Element {
let hook = UseWindowBuilder::default().use_height(&cx);
cx.render(rsx!(
h1 { "Window height: {hook}" }
))
}Source§impl UseWindowBuilder
impl UseWindowBuilder
Sourcepub fn use_window<'a>(&self, cx: &'a ScopeState) -> &'a mut UseWindow
pub fn use_window<'a>(&self, cx: &'a ScopeState) -> &'a mut UseWindow
Trait Implementations§
Source§impl Clone for UseWindowBuilder
impl Clone for UseWindowBuilder
Source§fn clone(&self) -> UseWindowBuilder
fn clone(&self) -> UseWindowBuilder
Returns a duplicate of the value. Read more
1.0.0 · 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 UseWindowBuilder
impl Debug for UseWindowBuilder
Source§impl Default for UseWindowBuilder
impl Default for UseWindowBuilder
impl Copy for UseWindowBuilder
Auto Trait Implementations§
impl Freeze for UseWindowBuilder
impl RefUnwindSafe for UseWindowBuilder
impl Send for UseWindowBuilder
impl Sync for UseWindowBuilder
impl Unpin for UseWindowBuilder
impl UnwindSafe for UseWindowBuilder
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