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§
§impl<T> Selector<T>where
T: Any,
impl<T> Selector<T>where T: Any,
pub 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§
§impl<T> PartialEq<Selector<T>> for Selector<T>where
T: PartialEq<T>,
impl<T> PartialEq<Selector<T>> for Selector<T>where T: PartialEq<T>,
impl<T> Copy for Selector<T>
impl<T> Eq for Selector<T>where T: Eq,
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§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§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.