pub struct EBrake { /* private fields */ }Expand description
The emergency brake is a circular queue of boolean samples with a defined size and tolerance.
Implementations§
Trait Implementations§
Source§impl EmergencyBrake for EBrake
impl EmergencyBrake for EBrake
Source§fn add_sample(&mut self, sample: bool)
fn add_sample(&mut self, sample: bool)
Insert a sample into the emergency brake.
This will pop the oldest sample if the queue is full.
true indicates a success, false indicates a failure.Source§fn should_trigger(&self) -> bool
fn should_trigger(&self) -> bool
Returns true if the emergency brake should be triggered.
Returns false if the emergency brake should not be triggered.
Source§fn trigger(&self, trigger: &'static Trigger) -> bool
fn trigger(&self, trigger: &'static Trigger) -> bool
Returns false if the emergency brake has not been triggered.
If the emergency brake has been triggered, the process supplied trigger action will be executed.
Source§fn trigger_abort(&self) -> bool
fn trigger_abort(&self) -> bool
Returns false if the emergency brake has not been triggered.
If the emergency brake has been triggered, the process will be aborted.
Source§fn trigger_panic(&self) -> bool
fn trigger_panic(&self) -> bool
Returns false if the emergency brake has not been triggered.
If the emergency brake has been triggered, a panic will occur.
Auto Trait Implementations§
impl Freeze for EBrake
impl RefUnwindSafe for EBrake
impl Send for EBrake
impl Sync for EBrake
impl Unpin for EBrake
impl UnwindSafe for EBrake
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