Type Alias freya::prelude::KeyboardEvent

source ·
pub type KeyboardEvent = Event<KeyboardData>;

Aliased Type§

struct KeyboardEvent {
    pub data: Rc<KeyboardData, Global>,
    /* private fields */
}

Fields§

§data: Rc<KeyboardData, Global>

The data associated with this event

Implementations§

§

impl<T> Event<T>

pub fn cancel_bubble(&self)

👎Deprecated: use stop_propagation instead

Prevent this event from continuing to bubble up the tree to parent elements.

Example
rsx! {
    button {
        onclick: move |evt: Event<MouseData>| {
            evt.cancel_bubble();
        }
    }
}

pub fn stop_propagation(&self)

Prevent this event from continuing to bubble up the tree to parent elements.

Example
rsx! {
    button {
        onclick: move |evt: Event<MouseData>| {
            evt.stop_propagation();
        }
    }
}

pub fn inner(&self) -> &Rc<T, Global>

Get a reference to the inner data from this event

rsx! {
    button {
        onclick: move |evt: Event<MouseData>| {
            let data = evt.inner.clone();
            cx.spawn(async move {
                println!("{:?}", data);
            });
        }
    }
}

Methods from Deref<Target = Rc<T, Global>>§

pub fn cancel_bubble(&self)

👎Deprecated: use stop_propagation instead

Prevent this event from continuing to bubble up the tree to parent elements.

Example
rsx! {
    button {
        onclick: move |evt: Event<MouseData>| {
            evt.cancel_bubble();
        }
    }
}

pub fn stop_propagation(&self)

Prevent this event from continuing to bubble up the tree to parent elements.

Example
rsx! {
    button {
        onclick: move |evt: Event<MouseData>| {
            evt.stop_propagation();
        }
    }
}

pub fn inner(&self) -> &Rc<T, Global>

Get a reference to the inner data from this event

rsx! {
    button {
        onclick: move |evt: Event<MouseData>| {
            let data = evt.inner.clone();
            cx.spawn(async move {
                println!("{:?}", data);
            });
        }
    }
}

Trait Implementations§

§

impl<T> Clone for Event<T>where T: ?Sized,

§

fn clone(&self) -> Event<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for Event<T>where T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Deref for Event<T>

§

type Target = Rc<T, Global>

The resulting type after dereferencing.
§

fn deref(&self) -> &<Event<T> as Deref>::Target

Dereferences the value.