Skip to main content

Action

Struct Action 

Source
pub struct Action<Message> { /* private fields */ }
Expand description

A runtime action that can be performed by some widgets.

Implementations§

Source§

impl<Message> Action<Message>

Source

pub fn capture() -> Self

Creates a new “capturing” Action. A capturing Action will make other widgets consider it final and prevent further processing.

Prevents “event bubbling”.

Source

pub fn publish(message: Message) -> Self

Creates a new Action that publishes the given Message for the application to handle.

Publishing a Message always produces a redraw.

Source

pub fn request_redraw() -> Self

Creates a new Action that requests a redraw to happen as soon as possible; without publishing any Message.

Source

pub fn request_redraw_at(at: Instant) -> Self

Creates a new Action that requests a redraw to happen at the given Instant; without publishing any Message.

This can be useful to efficiently animate content, like a blinking caret on a text input.

Source

pub fn and_capture(self) -> Self

Marks the Action as “capturing”. See Self::capture.

Source

pub fn into_inner(self) -> (Option<Message>, RedrawRequest, Status)

Converts the Action into its internal parts.

This method is meant to be used by runtimes, libraries, or internal widget implementations.

Trait Implementations§

Source§

impl<Message: Clone> Clone for Action<Message>

Source§

fn clone(&self) -> Action<Message>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Message: Debug> Debug for Action<Message>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Message> Freeze for Action<Message>
where Message: Freeze,

§

impl<Message> RefUnwindSafe for Action<Message>
where Message: RefUnwindSafe,

§

impl<Message> Send for Action<Message>
where Message: Send,

§

impl<Message> Sync for Action<Message>
where Message: Sync,

§

impl<Message> Unpin for Action<Message>
where Message: Unpin,

§

impl<Message> UnsafeUnpin for Action<Message>
where Message: UnsafeUnpin,

§

impl<Message> UnwindSafe for Action<Message>
where Message: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,