pub struct AlarmUnit {
panic_on_unmasked_alarm: bool,
masked: BTreeSet<AlarmKind>,
active: BTreeMap<AlarmKind, Alarm>,
changes: ChangeIndex<AlarmKind>,
}
Expand description
An alarm is in one of the following states:
- inactive: it’s not happening
- firing: it’s happening and not masked (execution will stop)
- active but not firing (visible on the console, execution continues)
Fields§
§panic_on_unmasked_alarm: bool
§masked: BTreeSet<AlarmKind>
§active: BTreeMap<AlarmKind, Alarm>
§changes: ChangeIndex<AlarmKind>
Implementations§
Source§impl AlarmUnit
impl AlarmUnit
pub fn new() -> AlarmUnit
fn status_for_alarm_kind(&self, kind: &AlarmKind) -> AlarmStatus
pub fn get_alarm_statuses(&self) -> Vec<AlarmStatus>
pub fn drain_alarm_changes(&mut self) -> BTreeMap<AlarmKind, AlarmStatus>
pub fn get_status_of_alarm(&self, name: &str) -> Option<AlarmStatus>
pub fn new_with_panic(panic: bool) -> AlarmUnit
pub fn mask( &mut self, kind: AlarmKind, diags: &CurrentInstructionDiagnostics, ) -> Result<(), Alarm>
pub fn unmask(&mut self, kind: AlarmKind)
fn is_masked(&self, alarm_instance: &Alarm) -> bool
fn maybe_panic(&self, alarm_instance: &Alarm)
pub fn clear_all_alarms(&mut self)
pub fn unmasked_alarm_active(&self) -> bool
fn set_active(&mut self, alarm_instance: Alarm) -> Result<(), Alarm>
Trait Implementations§
Source§impl Alarmer for AlarmUnit
impl Alarmer for AlarmUnit
Source§fn fire_if_not_masked<F: DiagnosticFetcher>(
&mut self,
alarm_instance: Alarm,
_get_diags: F,
) -> Result<(), Alarm>
fn fire_if_not_masked<F: DiagnosticFetcher>( &mut self, alarm_instance: Alarm, _get_diags: F, ) -> Result<(), Alarm>
Fire the indicated alarm if it is not masked.
Source§fn always_fire<F: DiagnosticFetcher>(
&mut self,
alarm_instance: Alarm,
get_diagnostics: F,
) -> Alarm
fn always_fire<F: DiagnosticFetcher>( &mut self, alarm_instance: Alarm, get_diagnostics: F, ) -> Alarm
Unconditionally fire the indicated alarm.
Auto Trait Implementations§
impl Freeze for AlarmUnit
impl RefUnwindSafe for AlarmUnit
impl Send for AlarmUnit
impl Sync for AlarmUnit
impl Unpin for AlarmUnit
impl UnwindSafe for AlarmUnit
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.