pub trait TriggerEvent: From<Self::Action> + PartialOrd {
type Action: TriggerAction + ConditionalSerde;
type Identifier: TriggerEventIdentifier + ConditionalSerde;
// Required method
fn identifier(&self) -> Self::Identifier;
// Provided method
fn partial_cmp_progress(
&self,
other: &Self,
target_ordering: Ordering,
) -> Option<f64> { ... }
}Expand description
A trigger event.
Required Associated Types§
Sourcetype Action: TriggerAction + ConditionalSerde
type Action: TriggerAction + ConditionalSerde
The action type used by the trigger event.
Sourcetype Identifier: TriggerEventIdentifier + ConditionalSerde
type Identifier: TriggerEventIdentifier + ConditionalSerde
The identifier of a trigger event.
See TriggerEventIdentifier for details.
Required Methods§
Sourcefn identifier(&self) -> Self::Identifier
fn identifier(&self) -> Self::Identifier
Returns the identifier of this trigger event.
Provided Methods§
Sourcefn partial_cmp_progress(
&self,
other: &Self,
target_ordering: Ordering,
) -> Option<f64>
fn partial_cmp_progress( &self, other: &Self, target_ordering: Ordering, ) -> Option<f64>
Returns a number between 0.0 and 1.0 indicating how close the ordering of this and other is to the target ordering.
If the events are not ordered, then None is returned.
If progress reporting is not needed when using this library, feel free to stick with the default implementation of this method.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.