pub struct EventSpec<F: IntegrateFloat> {
pub id: String,
pub direction: EventDirection,
pub action: EventAction,
pub threshold: F,
pub max_count: Option<usize>,
pub precise_time: bool,
}Expand description
Definition of an event to detect during integration
Fields§
§id: StringUnique identifier for this event type
direction: EventDirectionDirection of zero-crossing to detect
action: EventActionAction to take when event is detected
threshold: FTolerance for considering event to be triggered (prevents chattering)
max_count: Option<usize>Maximum number of detections (None for unlimited)
precise_time: boolWhether to refine the event time with high precision
Implementations§
Source§impl<F: IntegrateFloat> EventSpec<F>
impl<F: IntegrateFloat> EventSpec<F>
Sourcepub fn max_count_reached(&self, currentcount: Option<usize>) -> bool
pub fn max_count_reached(&self, currentcount: Option<usize>) -> bool
Check if the maximum count has been reached for this event
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for EventSpec<F>where
F: Freeze,
impl<F> RefUnwindSafe for EventSpec<F>where
F: RefUnwindSafe,
impl<F> Send for EventSpec<F>where
F: Send,
impl<F> Sync for EventSpec<F>where
F: Sync,
impl<F> Unpin for EventSpec<F>where
F: Unpin,
impl<F> UnwindSafe for EventSpec<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more