Struct ev3dev_lang_rust::PowerSupply[][src]

pub struct PowerSupply { /* fields omitted */ }

An interface to read data from the system’s power_supply class. Uses the built-in legoev3-battery if none is specified.

Implementations

impl PowerSupply[src]

pub fn new() -> Ev3Result<PowerSupply>[src]

Create a new instance of PowerSupply.

pub fn get_current_now(&self) -> Ev3Result<i32>[src]

Returns the battery current in microamps

pub fn get_scope(&self) -> Ev3Result<String>[src]

Always returns System.

pub fn get_technology(&self) -> Ev3Result<String>[src]

Returns Unknown or Li-ion depending on if the rechargeable battery is present.

pub fn get_type(&self) -> Ev3Result<String>[src]

Always returns Battery.

pub fn get_voltage_max_design(&self) -> Ev3Result<i32>[src]

Returns the nominal “full” battery voltage. The value returned depends on technology.

pub fn get_voltage_min_design(&self) -> Ev3Result<i32>[src]

Returns the nominal “empty” battery voltage. The value returned depends on technology.

pub fn get_voltage_now(&self) -> Ev3Result<i32>[src]

Returns the battery voltage in microvolts.

Trait Implementations

impl Clone for PowerSupply[src]

impl Debug for PowerSupply[src]

impl Device for PowerSupply[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.