Trait TriggerEvent

Source
pub trait TriggerEvent: From<Self::Action> + PartialOrd {
    type Action: TriggerAction + ConditionalSerde;
    type Identifier: TriggerIdentifier + ConditionalSerde;

    // Required methods
    fn identifier(&self) -> Self::Identifier;
    fn partial_cmp_progress(
        &self,
        other: &Self,
        target_ordering: Ordering,
    ) -> Option<f64>;
}
Expand description

A trigger event.

Required Associated Types§

Source

type Action: TriggerAction + ConditionalSerde

The action type used by the trigger event.

Source

type Identifier: TriggerIdentifier + ConditionalSerde

The identifier of a trigger event.

This type should be cheap to clone.

Required Methods§

Source

fn identifier(&self) -> Self::Identifier

Returns the identifier of this trigger event.

Source

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.

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.

Implementations on Foreign Types§

Source§

impl TriggerEvent for ()

Source§

type Action = ()

Source§

type Identifier = ()

Source§

fn identifier(&self) -> Self::Identifier

Source§

fn partial_cmp_progress(&self, _other: &Self, ordering: Ordering) -> Option<f64>

Implementors§