TriggerEvent

Trait TriggerEvent 

Source
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§

Source

type Action: TriggerAction + ConditionalSerde

The action type used by the trigger event.

Source

type Identifier: TriggerEventIdentifier + ConditionalSerde

The identifier of a trigger event.

See TriggerEventIdentifier for details.

Required Methods§

Source

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

Returns the identifier of this trigger event.

Provided Methods§

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.

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.

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§