pub struct UseCursorBuilder {}
Expand description
Implementations§
Source§impl UseCursorBuilder
impl UseCursorBuilder
Sourcepub fn use_cursor<'a>(&self, cx: &'a ScopeState) -> &'a mut UseCursor
pub fn use_cursor<'a>(&self, cx: &'a ScopeState) -> &'a mut UseCursor
hooks for window’s size with config
§Arguments
cx
: [Scope
] orScopeState
returns: [WindowSize
]
§Examples
use dioxus::prelude::*;
use dioxus_use_cursor::use_cursor;
fn App(cx: Scope) -> Element {
let size = use_cursor(&cx);
cx.render(rsx!(
h1 { "Window size: {size}" }
))
}
Source§impl UseCursorBuilder
impl UseCursorBuilder
Sourcepub fn use_hover<'a>(&self, cx: &'a ScopeState) -> &'a mut UseHover
pub fn use_hover<'a>(&self, cx: &'a ScopeState) -> &'a mut UseHover
hooks for window’s size with config
§Arguments
cx
: [Scope
] orScopeState
returns: [WindowSize
]
§Examples
use dioxus::prelude::*;
use dioxus_use_cursor::use_hover;
fn App(cx: Scope) -> Element {
let hook = use_hover(&cx);
cx.render(rsx!(
h1 { "Cursor is hovering: {hook}" }
))
}
Trait Implementations§
Source§impl Clone for UseCursorBuilder
impl Clone for UseCursorBuilder
Source§fn clone(&self) -> UseCursorBuilder
fn clone(&self) -> UseCursorBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UseCursorBuilder
impl Debug for UseCursorBuilder
Source§impl Default for UseCursorBuilder
impl Default for UseCursorBuilder
impl Copy for UseCursorBuilder
Auto Trait Implementations§
impl Freeze for UseCursorBuilder
impl RefUnwindSafe for UseCursorBuilder
impl Send for UseCursorBuilder
impl Sync for UseCursorBuilder
impl Unpin for UseCursorBuilder
impl UnwindSafe for UseCursorBuilder
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