Struct ev3dev_lang_rust::PowerSupply[][src]

pub struct PowerSupply { /* fields omitted */ }
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

Create a new instance of PowerSupply.

Returns the battery current in microamps

Always returns System.

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

Always returns Battery.

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

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

Returns the battery voltage in microvolts.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the attribute wrapper for an attribute name.

Returns the name of the port that the motor is connected to.

Sends a command to the device controller.

Returns a space separated list of commands that are supported by the device controller.

Returns the name of the driver that provides this device.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.