use-electricity 0.0.1

Electricity and simple circuit helpers for RustUse
Documentation
  • Coverage
  • 84%
    21 out of 25 items documented9 out of 20 items with examples
  • Size
  • Source code size: 16.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 471.19 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-physics
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-electricity

Electricity-specific scalar helpers for RustUse.

Install

[dependencies]
use-electricity = "0.0.1"

Foundation

use-electricity provides small helpers for charge, current, voltage, resistance, conductance, electrical power, electrical energy, Coulomb force, and simple series or parallel resistance calculations.

Inputs are expected to be SI-style numeric values:

  • coulombs for charge
  • amperes for current
  • seconds for time
  • volts for voltage
  • ohms for resistance
  • siemens for conductance
  • watts for power
  • joules for energy
  • meters for distance
  • newtons for force

The crate does not define a full unit system. More general units and constants belong in the top-level use-units and use-constants sets.

Example

use use_electricity::{ElectricalLoad, power_from_voltage_current, voltage};

assert_eq!(voltage(2.0, 5.0), Some(10.0));
assert_eq!(power_from_voltage_current(10.0, 2.0), Some(20.0));

let load = ElectricalLoad::new(10.0, 5.0).expect("valid load");
assert_eq!(load.power(), Some(20.0));

When to use directly

Choose use-electricity when you need reusable scalar electricity formulas without bringing in a broader circuit or unit system.

Scope

  • APIs stay f64-first and deliberately small.
  • Circuit analysis is intentionally minimal and limited to simple scalar helpers.
  • Broader constants, waveform modeling, signal processing, and measurement systems are out of scope.

Status

use-electricity is a pre-1.0 crate with a deliberately small API.