pub struct Phydat {
values: phydat_t,
length: u8,
}
Available on
riot_module_saul
only.Expand description
A wrapper around phydat_t that keeps the values and the number of valid values in one place.
Fields§
§values: phydat_t
§length: u8
Implementations§
Source§impl Phydat
impl Phydat
Sourcepub fn fit(data: &[i32], unit: Option<Unit>, scale: i8) -> Self
pub fn fit(data: &[i32], unit: Option<Unit>, scale: i8) -> Self
Create a new pydat data value, from data adjusted using the scale to fit in the i16 phydat uses internally
See phydat_fit for trade-offs.
§Panics
like new()
pub fn value(&self) -> &[i16]
pub fn unit(&self) -> Option<Unit>
pub fn scale(&self) -> i8
Trait Implementations§
impl Copy for Phydat
Auto Trait Implementations§
impl Freeze for Phydat
impl RefUnwindSafe for Phydat
impl Send for Phydat
impl Sync for Phydat
impl Unpin for Phydat
impl UnwindSafe for Phydat
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> IntoSwitch for T
impl<T> IntoSwitch for T
Source§fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
Source§fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 10 bytes