Struct GCDatapointValueQuality
#[repr(transparent)]pub struct GCDatapointValueQuality(u16);Expand description
The quality of a datapoint value Represents a u16 bit field similar to the IEC 61850 protocol with the following structure:
| bits | Attribute name | Attribute value |
|---|---|---|
| 0-1 | Validity | Good(00) / Invalid(01) / Reserved(10) / Questionable(11) |
| 2 | Overflow | TRUE(1) / FALSE(0) |
| 3 | OutOfRange | TRUE(1) / FALSE(0) |
| 4 | BadReference | TRUE(1) / FALSE(0) |
| 5 | Oscillatory | TRUE(1) / FALSE(0) |
| 6 | Failure | TRUE(1) / FALSE(0) |
| 7 | OldData | TRUE(1) / FALSE(0) |
| 8 | Inconsistent | TRUE(1) / FALSE(0) |
| 9 | Inaccurate | TRUE(1) / FALSE(0) |
| 10 | Source | Process(0) / Substituted(1) |
| 11 | Test | TRUE(1) / FALSE(0) |
| 12 | OperatorBlocked | TRUE(1) / FALSE(0) |
| 13-15 | Reserved |
Each attribute has it’s own setter and query method.
Tuple Fields§
§0: u16Implementations§
§impl GCDatapointValueQuality
impl GCDatapointValueQuality
pub fn new_good() -> GCDatapointValueQuality
pub fn set_good(&mut self) -> &mut GCDatapointValueQuality
pub fn set_invalid(&mut self) -> &mut GCDatapointValueQuality
pub fn set_questionable(&mut self) -> &mut GCDatapointValueQuality
pub fn set_overflow(&mut self) -> &mut GCDatapointValueQuality
pub fn set_out_of_range(&mut self) -> &mut GCDatapointValueQuality
pub fn set_bad_reference(&mut self) -> &mut GCDatapointValueQuality
pub fn set_oscillatory(&mut self) -> &mut GCDatapointValueQuality
pub fn set_failure(&mut self) -> &mut GCDatapointValueQuality
pub fn set_old_data(&mut self) -> &mut GCDatapointValueQuality
pub fn set_inconsistent(&mut self) -> &mut GCDatapointValueQuality
pub fn set_inaccurate(&mut self) -> &mut GCDatapointValueQuality
pub fn set_source_processing(&mut self) -> &mut GCDatapointValueQuality
pub fn set_test(&mut self) -> &mut GCDatapointValueQuality
pub fn set_operator_blocked(&mut self) -> &mut GCDatapointValueQuality
pub fn is_good(&self) -> bool
pub fn is_invalid(&self) -> bool
pub fn is_questionable(&self) -> bool
pub fn is_overflow(&self) -> bool
pub fn is_out_of_range(&self) -> bool
pub fn is_bad_reference(&self) -> bool
pub fn is_oscillatory(&self) -> bool
pub fn is_failure(&self) -> bool
pub fn is_old_data(&self) -> bool
pub fn is_inconsistent(&self) -> bool
pub fn is_inaccurate(&self) -> bool
pub fn is_source_processing(&self) -> bool
pub fn is_test(&self) -> bool
pub fn is_operator_blocked(&self) -> bool
Trait Implementations§
§impl Clone for GCDatapointValueQuality
impl Clone for GCDatapointValueQuality
§fn clone(&self) -> GCDatapointValueQuality
fn clone(&self) -> GCDatapointValueQuality
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for GCDatapointValueQuality
impl Debug for GCDatapointValueQuality
§impl<'de> Deserialize<'de> for GCDatapointValueQuality
impl<'de> Deserialize<'de> for GCDatapointValueQuality
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GCDatapointValueQuality, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GCDatapointValueQuality, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<u16> for GCDatapointValueQuality
impl From<u16> for GCDatapointValueQuality
§fn from(quality: u16) -> GCDatapointValueQuality
fn from(quality: u16) -> GCDatapointValueQuality
Converts to this type from the input type.
§impl GCAbiConversion for GCDatapointValueQuality
impl GCAbiConversion for GCDatapointValueQuality
type CType = u16
§fn from_c(
c_type: <GCDatapointValueQuality as GCAbiConversion>::CType,
) -> GCDatapointValueQuality
fn from_c( c_type: <GCDatapointValueQuality as GCAbiConversion>::CType, ) -> GCDatapointValueQuality
Convert from the C type to the Rust type
§fn into_c(self) -> <GCDatapointValueQuality as GCAbiConversion>::CType
fn into_c(self) -> <GCDatapointValueQuality as GCAbiConversion>::CType
Convert from the Rust type to the C type
§fn from_c_ref(c_type: &Self::CType) -> &Self
fn from_c_ref(c_type: &Self::CType) -> &Self
Get a reference to the converted type
§unsafe fn from_c_ptr(ptr: *const Self::CType) -> &'static Self
unsafe fn from_c_ptr(ptr: *const Self::CType) -> &'static Self
Get a mutable reference to the C type Read more
§unsafe fn as_mut_ptr(&mut self) -> *mut Self::CType
unsafe fn as_mut_ptr(&mut self) -> *mut Self::CType
Get a mutable reference to the C type Read more
§impl PartialEq for GCDatapointValueQuality
impl PartialEq for GCDatapointValueQuality
§impl Serialize for GCDatapointValueQuality
impl Serialize for GCDatapointValueQuality
§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 GCDatapointValueQuality
Auto Trait Implementations§
impl Freeze for GCDatapointValueQuality
impl RefUnwindSafe for GCDatapointValueQuality
impl Send for GCDatapointValueQuality
impl Sync for GCDatapointValueQuality
impl Unpin for GCDatapointValueQuality
impl UnsafeUnpin for GCDatapointValueQuality
impl UnwindSafe for GCDatapointValueQuality
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