Skip to main content

Crate use_component

Crate use_component 

Source
Expand description

§use-component

Primitive electronic component identity and classification.

use-component stores labels such as R1, C4, U2, D3, J1, and SW1 without turning them into schematic, BOM, inventory, or component database records.

§Example

use use_component::{ComponentKind, ReferenceDesignator};

let reference = ReferenceDesignator::new("R1")?;
let kind: ComponentKind = "resistor".parse()?;

assert_eq!(reference.as_str(), "R1");
assert_eq!(kind.to_string(), "resistor");

§Scope

Use this crate for small component labels, values, and classification. It does not model schematics, BOMs, inventory, or component databases.

Modules§

prelude
Commonly used component primitives.

Structs§

ComponentId
A stable component identifier.
ComponentValue
A descriptive component value such as 10k, 100nF, or STM32F4.
ReferenceDesignator
A reference designator such as R1, C4, U2, D3, J1, or SW1.

Enums§

ComponentKind
A small electronic component classification vocabulary.
ComponentKindParseError
Errors returned while parsing component kinds.
ComponentTextError
Errors returned by non-empty component text wrappers.