[][src]Struct druid::Command

pub struct Command {
    pub selector: Selector,
    // some fields omitted
}

An arbitrary command.

A Command consists of a Selector, that indicates what the command is, and an optional argument, that can be used to pass arbitrary data.

Examples

use druid::{Command, Selector};

let selector = Selector::new("process_rows");
let rows = vec![1, 3, 10, 12];
let command = Command::new(selector, rows);

assert_eq!(command.get_object(), Some(&vec![1, 3, 10, 12]));

Fields

selector: Selector

Methods

impl Command[src]

pub fn new(selector: Selector, arg: impl Any) -> Self[src]

Create a new Command with an argument. If you do not need an argument, Selector implements Into<Command>.

pub fn get_object<T: Any>(&self) -> Option<&T>[src]

Return a reference to this command's object, if it has one.

Trait Implementations

impl Clone for Command[src]

impl Debug for Command[src]

impl From<Selector> for Command[src]

Auto Trait Implementations

impl !RefUnwindSafe for Command

impl !Send for Command

impl !Sync for Command

impl Unpin for Command

impl !UnwindSafe for Command

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> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.