Skip to main content

TogglingTriggerCriteria

Struct TogglingTriggerCriteria 

Source
pub struct TogglingTriggerCriteria<AC, DC> { /* private fields */ }
Expand description

A pair of activation and deactivation criteria that can be bound to emitted events.

Implementations§

Source§

impl<AC, DC> TogglingTriggerCriteria<AC, DC>

Source

pub fn new(activation_criterion: AC, deactivation_criterion: DC) -> Self

Create a toggling trigger criteria pair that starts inactive and uses repeating mode.

Source

pub fn initially_active(self) -> Self

Start the completed toggling trigger in the active state.

See TogglingTrigger::initially_active for the runtime semantics.

Source

pub fn initially_inactive(self) -> Self

Start the completed toggling trigger in the inactive state.

This is the default state. See TogglingTrigger::initially_inactive for the runtime semantics.

Source

pub fn once(self) -> Self

Run the completed toggling trigger through one active period and then disable it.

This sets the mode of the completed TogglingTrigger, not the mode of either component criterion.

Source

pub fn repeating(self) -> Self

Keep the completed toggling trigger enabled after deactivation so it can activate again.

This is the default mode. This sets the mode of the completed TogglingTrigger, not the mode of either component criterion.

Source

pub fn emit_with<ActiveEv, InactiveEv, MakeActive, MakeInactive>( self, make_active_event: MakeActive, make_inactive_event: MakeInactive, ) -> TogglingTrigger<AC, DC, ActiveEv, InactiveEv, MakeActive, MakeInactive>
where ActiveEv: IxaEvent, InactiveEv: IxaEvent, MakeActive: Fn(AC::Observation) -> ActiveEv + 'static, MakeInactive: Fn(DC::Observation) -> InactiveEv + 'static,

Bind this pair of criteria to constructors for activation and deactivation events.

Source

pub fn emit_values<ActiveEv, InactiveEv>( self, active_event: ActiveEv, inactive_event: InactiveEv, ) -> TogglingTrigger<AC, DC, ActiveEv, InactiveEv, impl Fn(AC::Observation) -> ActiveEv, impl Fn(DC::Observation) -> InactiveEv>
where ActiveEv: IxaEvent, InactiveEv: IxaEvent,

Bind this pair of criteria to constant activation and deactivation event values.

Source

pub fn emit_defaults<ActiveEv, InactiveEv>( self, ) -> TogglingTrigger<AC, DC, ActiveEv, InactiveEv, impl Fn(AC::Observation) -> ActiveEv, impl Fn(DC::Observation) -> InactiveEv>
where ActiveEv: IxaEvent + Default, InactiveEv: IxaEvent + Default,

Bind this pair of criteria to default-valued activation and deactivation events.

Auto Trait Implementations§

§

impl<AC, DC> Freeze for TogglingTriggerCriteria<AC, DC>
where AC: Freeze, DC: Freeze,

§

impl<AC, DC> RefUnwindSafe for TogglingTriggerCriteria<AC, DC>

§

impl<AC, DC> Send for TogglingTriggerCriteria<AC, DC>
where AC: Send, DC: Send,

§

impl<AC, DC> Sync for TogglingTriggerCriteria<AC, DC>
where AC: Sync, DC: Sync,

§

impl<AC, DC> Unpin for TogglingTriggerCriteria<AC, DC>
where AC: Unpin, DC: Unpin,

§

impl<AC, DC> UnsafeUnpin for TogglingTriggerCriteria<AC, DC>
where AC: UnsafeUnpin, DC: UnsafeUnpin,

§

impl<AC, DC> UnwindSafe for TogglingTriggerCriteria<AC, DC>
where AC: UnwindSafe, DC: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,