#[repr(i32)]pub enum SafetyState {
Unspecified = 0,
Safe = 1,
Armed = 2,
Ready = 3,
Firing = 4,
Cooldown = 5,
Fault = 6,
Maintenance = 7,
}Expand description
Weapon safety state - strict state machine
Variants§
Unspecified = 0
Safe = 1
Safe - cannot fire, all interlocks engaged Transition: SAFE -> ARMED requires authorization
Armed = 2
Armed - ready to engage, safety interlocks disengaged Transition: ARMED -> READY when firing solution valid
Ready = 3
Ready - firing solution valid, authorized to engage Transition: READY -> FIRING on trigger
Firing = 4
Firing - currently engaging target Transition: FIRING -> READY or COOLDOWN after engagement
Cooldown = 5
Cooldown - post-firing cooldown period Transition: COOLDOWN -> ARMED after cooldown complete
Fault = 6
Fault - safety interlock tripped, requires manual reset Transition: FAULT -> SAFE requires maintenance action
Maintenance = 7
Maintenance - system under maintenance, cannot arm
Implementations§
Source§impl SafetyState
impl SafetyState
Source§impl SafetyState
impl SafetyState
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for SafetyState
impl Clone for SafetyState
Source§fn clone(&self) -> SafetyState
fn clone(&self) -> SafetyState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SafetyState
impl Debug for SafetyState
Source§impl Default for SafetyState
impl Default for SafetyState
Source§fn default() -> SafetyState
fn default() -> SafetyState
Source§impl<'de> Deserialize<'de> for SafetyState
impl<'de> Deserialize<'de> for SafetyState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<SafetyState> for i32
impl From<SafetyState> for i32
Source§fn from(value: SafetyState) -> i32
fn from(value: SafetyState) -> i32
Source§impl Hash for SafetyState
impl Hash for SafetyState
Source§impl Ord for SafetyState
impl Ord for SafetyState
Source§fn cmp(&self, other: &SafetyState) -> Ordering
fn cmp(&self, other: &SafetyState) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SafetyState
impl PartialEq for SafetyState
Source§fn eq(&self, other: &SafetyState) -> bool
fn eq(&self, other: &SafetyState) -> bool
self and other values to be equal, and is used by ==.