pub struct Selector<T = ()>(_, _);
Expand description
An identifier for a particular command.
This should be a unique string identifier.
Having multiple selectors with the same identifier but different payload
types is not allowed and can cause Command::get
and get_unchecked
to panic.
The type parameter T
specifies the command’s payload type.
See Command
for more information.
Certain Selector
s are defined by Druid, and have special meaning
to the framework; these are listed in the druid::commands
module.
Implementations§
source§impl<T: Any> Selector<T>
impl<T: Any> Selector<T>
sourcepub fn with(self, payload: T) -> Command
pub fn with(self, payload: T) -> Command
Convenience method for Command::new
with this selector.
If the payload is ()
there is no need to call this,
as Selector<()>
implements Into<Command>
.
By default, the command will have Target::Auto
.
The Selector::to
method can be used to override this.
Trait Implementations§
source§impl<T: PartialEq> PartialEq<Selector<T>> for Selector<T>
impl<T: PartialEq> PartialEq<Selector<T>> for Selector<T>
impl<T> Copy for Selector<T>
impl<T: Eq> Eq for Selector<T>
impl<T> StructuralEq for Selector<T>
impl<T> StructuralPartialEq for Selector<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Selector<T>where
T: RefUnwindSafe,
impl<T> Send for Selector<T>where
T: Send,
impl<T> Sync for Selector<T>where
T: Sync,
impl<T> Unpin for Selector<T>where
T: Unpin,
impl<T> UnwindSafe for Selector<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.