Struct ev3dev_lang_rust::PowerSupply
source · pub struct PowerSupply { /* private fields */ }
Expand description
An interface to read data from the system’s power_supply class. Uses the built-in legoev3-battery if none is specified.
Implementations§
source§impl PowerSupply
impl PowerSupply
sourcepub fn new() -> Ev3Result<PowerSupply>
pub fn new() -> Ev3Result<PowerSupply>
Create a new instance of PowerSupply
.
sourcepub fn get_current_now(&self) -> Ev3Result<i32>
pub fn get_current_now(&self) -> Ev3Result<i32>
Returns the battery current in microamps
sourcepub fn get_technology(&self) -> Ev3Result<String>
pub fn get_technology(&self) -> Ev3Result<String>
Returns Unknown or Li-ion depending on if the rechargeable battery is present.
sourcepub fn get_voltage_max_design(&self) -> Ev3Result<i32>
pub fn get_voltage_max_design(&self) -> Ev3Result<i32>
Returns the nominal “full” battery voltage. The value returned depends on technology.
sourcepub fn get_voltage_min_design(&self) -> Ev3Result<i32>
pub fn get_voltage_min_design(&self) -> Ev3Result<i32>
Returns the nominal “empty” battery voltage. The value returned depends on technology.
sourcepub fn get_voltage_now(&self) -> Ev3Result<i32>
pub fn get_voltage_now(&self) -> Ev3Result<i32>
Returns the battery voltage in microvolts.
Trait Implementations§
source§impl Clone for PowerSupply
impl Clone for PowerSupply
source§fn clone(&self) -> PowerSupply
fn clone(&self) -> PowerSupply
Returns a copy 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 PowerSupply
impl Debug for PowerSupply
source§impl Device for PowerSupply
impl Device for PowerSupply
source§fn get_attribute(&self, name: &str) -> Attribute
fn get_attribute(&self, name: &str) -> Attribute
Returns the attribute wrapper for an attribute name.
source§fn get_address(&self) -> Ev3Result<String>
fn get_address(&self) -> Ev3Result<String>
Returns the name of the port that the motor is connected to.
source§fn set_command(&self, command: &str) -> Ev3Result<()>
fn set_command(&self, command: &str) -> Ev3Result<()>
Sends a command to the device controller.
source§fn get_commands(&self) -> Ev3Result<Vec<String>>
fn get_commands(&self) -> Ev3Result<Vec<String>>
Returns a space separated list of commands that are supported by the device controller.
source§fn get_driver_name(&self) -> Ev3Result<String>
fn get_driver_name(&self) -> Ev3Result<String>
Returns the name of the driver that provides this device.
Auto Trait Implementations§
impl !RefUnwindSafe for PowerSupply
impl Send for PowerSupply
impl !Sync for PowerSupply
impl Unpin for PowerSupply
impl UnwindSafe for PowerSupply
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