pub struct Generator { /* private fields */ }
Expand description
A connected generator.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn new(thing: Thing) -> Result<Self, GeneratorError>
pub fn new(thing: Thing) -> Result<Self, GeneratorError>
Create a new Generator from a generic “Thing”. LCI gateway must publish the type as a Generator.
Sourcepub async fn online(&self) -> Result<OnlineState, OnlineStateConversionError>
pub async fn online(&self) -> Result<OnlineState, OnlineStateConversionError>
Returns the device’s online state.
Sourcepub async fn on(&mut self) -> Result<(), SetError>
pub async fn on(&mut self) -> Result<(), SetError>
Sends the command to start the generator. The LCI system will automatically prime and attempt to start the generator.
Sourcepub async fn off(&mut self) -> Result<(), SetError>
pub async fn off(&mut self) -> Result<(), SetError>
Sends the command to turn off the generator.
Sourcepub async fn state(
&self,
) -> Result<GeneratorState, GeneratorStateConversionError>
pub async fn state( &self, ) -> Result<GeneratorState, GeneratorStateConversionError>
Gets the current state of the generator.
Auto Trait Implementations§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnwindSafe for Generator
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