pub struct Tank { /* private fields */ }
Expand description
A connected tank.
Implementations§
Source§impl Tank
impl Tank
Sourcepub fn new(thing: Thing) -> Result<Self, TankError>
pub fn new(thing: Thing) -> Result<Self, TankError>
Create a new Tank from a generic “Thing”. LCI gateway must publish the type as a Tank.
Sourcepub async fn online(&self) -> Result<OnlineState, OnlineStateConversionError>
pub async fn online(&self) -> Result<OnlineState, OnlineStateConversionError>
Returns the device’s online state.
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
Returns the label of the device such as “Fresh Water” or “Generator Fuel”.
Sourcepub async fn level(&self) -> Result<Percentage, TankLevelError>
pub async fn level(&self) -> Result<Percentage, TankLevelError>
Gets the current percentage of the tank. Note accuracy depends on your sensors.
Auto Trait Implementations§
impl Freeze for Tank
impl RefUnwindSafe for Tank
impl Send for Tank
impl Sync for Tank
impl Unpin for Tank
impl UnwindSafe for Tank
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