[][src]Struct iced_native::Command

pub struct Command<T> { /* fields omitted */ }

A collection of async operations.

You should be able to turn a future easily into a Command, either by using the From trait or Command::perform.

Implementations

impl<T> Command<T>[src]

pub fn none() -> Command<T>[src]

Creates an empty Command.

In other words, a Command that does nothing.

pub fn perform<A>(
    future: impl Send + Future<Output = T> + 'static,
    f: impl Send + Fn(T) -> A + 'static
) -> Command<A>
[src]

Creates a Command that performs the action of the given future.

pub fn map<A>(self, f: impl Send + Sync + Fn(T) -> A + 'static) -> Command<A> where
    T: 'static, 
[src]

Applies a transformation to the result of a Command.

pub fn batch(commands: impl IntoIterator<Item = Command<T>>) -> Command<T>[src]

Creates a Command that performs the actions of all the given commands.

Once this command is run, all the commands will be executed at once.

pub fn futures(
    self
) -> Vec<Pin<Box<dyn Future<Output = T> + 'static + Send, Global>>, Global>
[src]

Converts a Command into its underlying list of futures.

Trait Implementations

impl<T> Debug for Command<T>[src]

impl<T, A> From<A> for Command<T> where
    A: Future<Output = T> + 'static + Send
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Command<T>

impl<T> Send for Command<T>

impl<T> !Sync for Command<T>

impl<T> Unpin for Command<T>

impl<T> !UnwindSafe for Command<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,