EnergyStorageInterface

Trait EnergyStorageInterface 

Source
pub trait EnergyStorageInterface: RpcDevice {
    // Required methods
    fn get_energy_stored(&self) -> Result<i32>
       where i32: DeserializeOwned + 'static;
    fn get_max_energy_stored(&self) -> Result<i32>
       where i32: DeserializeOwned + 'static;
    fn can_extract_energy(&self) -> Result<bool>
       where bool: DeserializeOwned + 'static;
    fn can_receive_energy(&self) -> Result<bool>
       where bool: DeserializeOwned + 'static;
}
Expand description

An interface between an energy storage device and the HLAPI.

Required Methods§

Source

fn get_energy_stored(&self) -> Result<i32>
where i32: DeserializeOwned + 'static,

Retrieves the current amount of energy stored in FE.

Source

fn get_max_energy_stored(&self) -> Result<i32>
where i32: DeserializeOwned + 'static,

Retrieves the maximum possible energy that can be stored in the device in FE.

Source

fn can_extract_energy(&self) -> Result<bool>
where bool: DeserializeOwned + 'static,

Returns a boolean indicating whether the storage device can have energy extracted from it.

Source

fn can_receive_energy(&self) -> Result<bool>
where bool: DeserializeOwned + 'static,

Returns a boolean indicating whether the storage device can receive energy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§