pub struct SensorReading {
pub value: f64,
pub timestamp: u64,
pub source_id: String,
pub signature: Vec<u8>,
}Expand description
A sensor reading with cryptographic signature
Used for multi-source reality verification (Byzantine Fault Tolerance)
Fields§
§value: f64The measured value
timestamp: u64Unix timestamp when reading was taken
source_id: StringUnique identifier for the sensor
signature: Vec<u8>Cryptographic signature of (value, timestamp, source_id)
Implementations§
Source§impl SensorReading
impl SensorReading
Sourcepub fn signing_data(&self) -> Vec<u8> ⓘ
pub fn signing_data(&self) -> Vec<u8> ⓘ
Get the data to be signed
Trait Implementations§
Source§impl Clone for SensorReading
impl Clone for SensorReading
Source§fn clone(&self) -> SensorReading
fn clone(&self) -> SensorReading
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 moreSource§impl Debug for SensorReading
impl Debug for SensorReading
Source§impl<'de> Deserialize<'de> for SensorReading
impl<'de> Deserialize<'de> for SensorReading
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SensorReading
impl RefUnwindSafe for SensorReading
impl Send for SensorReading
impl Sync for SensorReading
impl Unpin for SensorReading
impl UnwindSafe for SensorReading
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