pub struct Operator {
pub id: String,
pub name: String,
pub rank: i32,
pub authority_level: i32,
pub mos: String,
pub metadata_json: String,
}Expand description
Human operator information
Fields§
§id: StringUnique operator identifier
name: StringOperator name
rank: i32Military rank
Authority level
mos: StringMilitary Occupational Specialty (MOS)
metadata_json: StringAdditional operator metadata
Implementations§
Source§impl Operator
impl Operator
Sourcepub fn rank(&self) -> OperatorRank
pub fn rank(&self) -> OperatorRank
Returns the enum value of rank, or the default if the field is set to an invalid enum value.
Sourcepub fn set_rank(&mut self, value: OperatorRank)
pub fn set_rank(&mut self, value: OperatorRank)
Sets rank to the provided enum value.
Returns the enum value of authority_level, or the default if the field is set to an invalid enum value.
Sets authority_level to the provided enum value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operator
impl<'de> Deserialize<'de> for Operator
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Operator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Operator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for Operator
impl Message for Operator
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl OperatorExt for Operator
impl OperatorExt for Operator
Source§fn new(
id: String,
name: String,
rank: OperatorRank,
authority: AuthorityLevel,
mos: String,
) -> Self
fn new( id: String, name: String, rank: OperatorRank, authority: AuthorityLevel, mos: String, ) -> Self
Create a new operator with default cognitive state
Source§fn update_cognitive_load(&mut self, load: f32)
fn update_cognitive_load(&mut self, load: f32)
Update cognitive load from metadata (clamped to 0.0-1.0)
Source§fn update_fatigue(&mut self, fatigue: f32)
fn update_fatigue(&mut self, fatigue: f32)
Update fatigue from metadata (clamped to 0.0-1.0)
Source§fn cognitive_load(&self) -> f32
fn cognitive_load(&self) -> f32
Get cognitive load from metadata
Source§fn is_overloaded(&self, threshold: f32) -> bool
fn is_overloaded(&self, threshold: f32) -> bool
Check if operator is overloaded (cognitive load > threshold)
Source§fn is_fatigued(&self, threshold: f32) -> bool
fn is_fatigued(&self, threshold: f32) -> bool
Check if operator is fatigued (fatigue > threshold)
Source§fn effectiveness(&self) -> f32
fn effectiveness(&self) -> f32
Get operator effectiveness score (0.0-1.0)
Considers cognitive load and fatigue
Source§impl Serialize for Operator
impl Serialize for Operator
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnsafeUnpin for Operator
impl UnwindSafe for Operator
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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